r17760: The DNS SRV lookup already sorts by priority and weight so don't
authorGerald Carter <jerry@samba.org>
Wed, 23 Aug 2006 21:04:47 +0000 (21:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:47 +0000 (11:38 -0500)
use the generic IP list sort in get_sorted_dc_list().
(This used to be commit 03a767539d5b09ebd6564c0c9157de2a6e0e6b89)

source3/libsmb/namequery.c

index f6dbe3c548347d3c5f4b0616df0f5e632fa8c20d..0bd8bc7cb2962b687e9b1c17dec3dd52c26ed755 100644 (file)
@@ -1356,6 +1356,9 @@ static BOOL get_dc_list(const char *domain, struct ip_service **ip_list,
        BOOL done_auto_lookup = False;
        int auto_count = 0;
 
+       *ordered = False;
+
+
        /* if we are restricted to solely using DNS for looking
           up a domain controller, make sure that host lookups
           are enabled for the 'name resolve order'.  If host lookups
@@ -1365,14 +1368,17 @@ static BOOL get_dc_list(const char *domain, struct ip_service **ip_list,
        fstrcpy( resolve_order, lp_name_resolve_order() );
        strlower_m( resolve_order );
        if ( ads_only )  {
-               if ( strstr( resolve_order, "host" ) )
+               if ( strstr( resolve_order, "host" ) ) {
                        fstrcpy( resolve_order, "ads" );
+
+                       /* DNS SRV lookups used by the ads resolver
+                          are already sorted by priority and weight */
+                       *ordered = True;
+               }
                else
                        fstrcpy( resolve_order, "NULL" );
        }
 
-       *ordered = False;
-       
        /* fetch the server we have affinity for.  Add the 
           'password server' list to a search for our domain controllers */