summaryrefslogtreecommitdiffstats
path: root/source/libsmb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-07-19 19:20:28 +0000
committerGerald Carter <jerry@samba.org>2006-07-19 19:20:28 +0000
commitcb10e23454954118034c133a30849394da73752d (patch)
tree796e8b041848b65f1d9b73df31daa370e4a65117 /source/libsmb
parentb4bb14b5950debe92edfb9cea233833cd8d768b6 (diff)
downloadsamba-cb10e23454954118034c133a30849394da73752d.tar.gz
samba-cb10e23454954118034c133a30849394da73752d.tar.xz
samba-cb10e23454954118034c133a30849394da73752d.zip
r17143: svn merge -r17091:17138 ../SAMBA_3_0_23/
Diffstat (limited to 'source/libsmb')
-rw-r--r--source/libsmb/namequery.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c
index 0172ab9514e..f6dbe3c5483 100644
--- a/source/libsmb/namequery.c
+++ b/source/libsmb/namequery.c
@@ -1051,16 +1051,18 @@ static BOOL resolve_ads(const char *name, int name_type,
return False;
}
- i = 0;
- while ( i < numdcs ) {
+ *return_count = 0;
+
+ for (i=0;i<numdcs;i++) {
+ struct ip_service *r = &(*return_iplist)[*return_count];
/* use the IP address from the SRV structure if we have one */
if ( is_zero_ip( dcs[i].ip ) )
- (*return_iplist)[i].ip = *interpret_addr2(dcs[i].hostname);
+ r->ip = *interpret_addr2(dcs[i].hostname);
else
- (*return_iplist)[i].ip = dcs[i].ip;
+ r->ip = dcs[i].ip;
- (*return_iplist)[i].port = dcs[i].port;
+ r->port = dcs[i].port;
/* make sure it is a valid IP. I considered checking the negative
connection cache, but this is the wrong place for it. Maybe only
@@ -1069,15 +1071,11 @@ static BOOL resolve_ads(const char *name, int name_type,
The standard reason for falling back to netbios lookups is that
our DNS server doesn't know anything about the DC's -- jerry */
- if ( is_zero_ip((*return_iplist)[i].ip) )
- continue;
-
- i++;
+ if ( ! is_zero_ip(r->ip) )
+ (*return_count)++;
}
TALLOC_FREE( dcs );
-
- *return_count = i;
return True;
}