mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
s3:libsmb: ads_dc_name() doesn't need to retry if we found a DC in the closest site
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
25a6e1c8e7
commit
56fc50b0aa
@ -60,7 +60,7 @@ static bool ads_dc_name(const char *domain,
|
|||||||
TALLOC_CTX *tmp_ctx = talloc_stackframe();
|
TALLOC_CTX *tmp_ctx = talloc_stackframe();
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
ADS_STRUCT *ads;
|
ADS_STRUCT *ads;
|
||||||
char *sitename;
|
const char *sitename;
|
||||||
int i;
|
int i;
|
||||||
char addr[INET6_ADDRSTRLEN];
|
char addr[INET6_ADDRSTRLEN];
|
||||||
|
|
||||||
@ -94,6 +94,11 @@ static bool ads_dc_name(const char *domain,
|
|||||||
has changed. If so, we need to re-do the DNS query
|
has changed. If so, we need to re-do the DNS query
|
||||||
to ensure we only find servers in our site. */
|
to ensure we only find servers in our site. */
|
||||||
|
|
||||||
|
#ifdef HAVE_ADS
|
||||||
|
if (ads_closest_dc(ads)) {
|
||||||
|
sitename = ads->config.client_site_name;
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
if (stored_sitename_changed(realm, sitename)) {
|
if (stored_sitename_changed(realm, sitename)) {
|
||||||
sitename = sitename_fetch(tmp_ctx, realm);
|
sitename = sitename_fetch(tmp_ctx, realm);
|
||||||
TALLOC_FREE(ads);
|
TALLOC_FREE(ads);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user