summaryrefslogtreecommitdiffstats
path: root/source/libsmb/domain_client_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/libsmb/domain_client_validate.c')
-rw-r--r--source/libsmb/domain_client_validate.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source/libsmb/domain_client_validate.c b/source/libsmb/domain_client_validate.c
index 04ce90895ae..42269a73f1e 100644
--- a/source/libsmb/domain_client_validate.c
+++ b/source/libsmb/domain_client_validate.c
@@ -22,8 +22,6 @@
#include "includes.h"
-extern struct in_addr ipzero;
-
extern pstring global_myname;
/***********************************************************************
@@ -86,8 +84,7 @@ machine %s. Error was : %s.\n", remote_machine, cli_errstr(pcli) ));
}
if (!attempt_netbios_session_request(pcli, global_myname, remote_machine, &dest_ip)) {
- DEBUG(0,("connect_to_password_server: machine %s rejected the NetBIOS \
-session request. Error was : %s.\n", remote_machine, cli_errstr(pcli) ));
+ DEBUG(0,("connect_to_password_server: machine %s rejected the NetBIOS session request.\n", remote_machine));
return False;
}
@@ -181,7 +178,7 @@ static BOOL attempt_connect_to_dc(struct cli_state *pcli, struct in_addr *ip,
* Ignore addresses we have already tried.
*/
- if (ip_equal(ipzero, *ip))
+ if (is_zero_ip(*ip))
return False;
if (!lookup_dc_name(global_myname, lp_workgroup(), ip, dc_name))
@@ -194,6 +191,7 @@ static BOOL attempt_connect_to_dc(struct cli_state *pcli, struct in_addr *ip,
We have been asked to dynamcially determine the IP addresses of
the PDC and BDC's for this DOMAIN, and query them in turn.
************************************************************************/
+
static BOOL find_connect_pdc(struct cli_state *pcli,
unsigned char *trust_passwd,
time_t last_change_time)
@@ -230,7 +228,7 @@ static BOOL find_connect_pdc(struct cli_state *pcli,
if((connected_ok = attempt_connect_to_dc(pcli, &ip_list[i], trust_passwd)))
break;
- ip_list[i] = ipzero; /* Tried and failed. */
+ zero_ip(&ip_list[i]); /* Tried and failed. */
}
/*
@@ -239,8 +237,10 @@ static BOOL find_connect_pdc(struct cli_state *pcli,
if(!connected_ok) {
i = (sys_random() % count);
- if (!(connected_ok = attempt_connect_to_dc(pcli, &ip_list[i], trust_passwd)))
- ip_list[i] = ipzero; /* Tried and failed. */
+ if (!is_zero_ip(ip_list[i]) {
+ if (!(connected_ok = attempt_connect_to_dc(pcli, &ip_list[i], trust_passwd)))
+ zero_ip(&ip_list[i]); /* Tried and failed. */
+ }
}
/*
@@ -253,14 +253,15 @@ static BOOL find_connect_pdc(struct cli_state *pcli,
* Note that from a WINS server the #1 IP address is the PDC.
*/
for(i = 0; i < count; i++) {
+ if (is_zero_ip(ip_list[i]))
+ continue;
+
if((connected_ok = attempt_connect_to_dc(pcli, &ip_list[i], trust_passwd)))
break;
}
}
SAFE_FREE(ip_list);
-
-
return connected_ok;
}