s3: correctly detect if the current dc is the closest one
authorStefan Metzmacher <metze@samba.org>
Wed, 22 Oct 2008 08:36:21 +0000 (10:36 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 13 Dec 2008 11:27:50 +0000 (12:27 +0100)
ads->config.tried_closest_dc was never set.

metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit dfe5b00db35e1e7c7bb3ba36729fc3f97eb48db3)
(cherry picked from commit 588f5aae669910fee6da7f807f330163496b4170)
(cherry picked from commit b609f41baa035a15dafb18b2ec569a2b96968b17)

source/include/ads.h
source/libads/ndr.c
source/utils/net_ads.c

index d5ce88babe5f6888c00c3771109648c6d396b8d6..5a6a5f8ccb7d19392359ea1f40b2dccf2b7b9fd7 100644 (file)
@@ -78,7 +78,6 @@ typedef struct ads_struct {
                char *server_site_name;
                char *client_site_name;
                time_t current_time;
-               int tried_closest_dc;
                char *schema_path;
                char *config_path;
        } config;
index 6324a22041fdbe713f637b8eeefa282d0191ed54..6ada66ca40d9ccf1eb2a4d5eb8c8fddd71d055a5 100644 (file)
@@ -75,7 +75,6 @@ void ndr_print_ads_struct(struct ndr_print *ndr, const char *name, const struct
        ndr_print_string(ndr, "server_site_name", r->config.server_site_name);
        ndr_print_string(ndr, "client_site_name", r->config.client_site_name);
        ndr_print_time_t(ndr, "current_time", r->config.current_time);
-       ndr_print_bool(ndr, "tried_closest_dc", r->config.tried_closest_dc);
        ndr_print_string(ndr, "schema_path", r->config.schema_path);
        ndr_print_string(ndr, "config_path", r->config.config_path);
        ndr->depth--;
index ef6b15122d651d221ec7fdce0cca6a8b854fbdd0..a023a11a066171bd301703ca65dfcc29b6c14f24 100644 (file)
@@ -306,7 +306,7 @@ retry:
 
                tried_closest_dc = True; /* avoid loop */
 
-               if (!ads->config.tried_closest_dc) {
+               if (!ads_closest_dc(ads)) {
 
                        namecache_delete(ads->server.realm, 0x1C);
                        namecache_delete(ads->server.workgroup, 0x1C);