ソースを参照

dns: naptr local preferences fix

- in some cases the local preference for a protocol
  (dns_{udp,tcp,sctp,tls}_pref) was ignored (depending on the
  order of the records).

Reported-by: Vladimir Broz, vbroz at iptel org
Tested-by:   Vladimir Broz, vbroz at iptel org
Andrei Pelinescu-Onciul 17 年 前
コミット
218c9f41a2
1 ファイル変更3 行追加2 行削除
  1. 3 2
      resolve.c

+ 3 - 2
resolve.c

@@ -896,8 +896,9 @@ int naptr_choose (struct naptr_rdata** crt, char* crt_proto,
 	if ((*crt==0) || ((*crt_proto!=n_proto) && 
 						( naptr_proto_preferred(n_proto, *crt_proto))) )
 			goto change;
-	if ((n->order<(*crt)->order) || ((n->order== (*crt)->order) &&
-									(n->pref < (*crt)->pref))){
+	if (!naptr_proto_preferred(*crt_proto, n_proto) && 
+			((n->order<(*crt)->order) || ((n->order== (*crt)->order) &&
+								(n->pref < (*crt)->pref)))){
 			goto change;
 	}
 #ifdef NAPTR_DBG