From 779ec8d3cffed1c56153c8d214abd3ce2c2161b3 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 4 Dec 2002 19:01:01 +0000 Subject: [merge] remove assert(count ==1) for multi-homed PDCs; CR 1277 (This used to be commit 18799c115b05d6662350509f6662dbfceb4b71f5) --- source3/libsmb/namequery.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 98d9661567..0f81ff3eab 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1216,15 +1216,34 @@ BOOL get_pdc_ip(const char *domain, struct in_addr *ip) { struct in_addr *ip_list; int count; + int i = 0; /* Look up #1B name */ if (!internal_resolve_name(domain, 0x1b, &ip_list, &count)) return False; - SMB_ASSERT(count == 1); + /* if we get more than 1 IP back we have to assume it is a + multi-homed PDC and not a mess up */ + + if ( count > 1 ) { + DEBUG(6,("get_pdc_ip: PDC has %d IP addresses!\n", count)); + + /* look for a local net */ + for ( i=0; i