summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-07-03 04:54:49 +0000
committerGerald Carter <jerry@samba.org>2003-07-03 04:54:49 +0000
commitd304a61cc70af9bec3f630043f3e7e600352deea (patch)
tree4e8d68827f2d45555756db9effb0668298fb9ba1 /source3/libsmb
parent40ece6552de6049ae69312cca3691c29e7379d47 (diff)
downloadsamba-d304a61cc70af9bec3f630043f3e7e600352deea.tar.gz
samba-d304a61cc70af9bec3f630043f3e7e600352deea.tar.bz2
samba-d304a61cc70af9bec3f630043f3e7e600352deea.zip
fix bug #190; WINS server was getting marked as dead when it was not.
(This used to be commit fa354f3ceefe53bdfd4f543559041d337b75613f)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/namequery.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 81c0c14437..9875f77c72 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -516,7 +516,9 @@ struct in_addr *name_query(int fd,const char *name,int name_type,
}
}
- if (timed_out) {
+ /* only set timed_out if we didn't fund what we where looking for*/
+
+ if ( !found && timed_out ) {
*timed_out = True;
}
@@ -792,7 +794,10 @@ BOOL resolve_wins(const char *name, int name_type,
ip_list = name_query(sock,name,name_type, False,
True, wins_ip, return_count, &flags,
&timed_out);
- if ( !ip_list )
+
+ /* exit loop if we got a list of addresses */
+
+ if ( ip_list )
goto success;
close(sock);
@@ -1278,6 +1283,13 @@ BOOL get_dc_list(const char *domain, struct ip_service **ip_list,
if ( (num_addresses == 0) && !done_auto_lookup )
return internal_resolve_name(domain, 0x1C, ip_list, count, resolve_oder);
+ /* maybe we just failed? */
+
+ if ( num_addresses == 0 ) {
+ DEBUG(4,("get_dc_list: no servers found\n"));
+ return False;
+ }
+
if ( (return_iplist = (struct ip_service *)
malloc(num_addresses * sizeof(struct ip_service))) == NULL )
{