r11253: Fix an annoying timeout when no nmbd is around
authorVolker Lendecke <vlendec@samba.org>
Fri, 21 Oct 2005 21:46:49 +0000 (21:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:09 +0000 (11:05 -0500)
source/nsswitch/winbindd_cm.c

index c91f9555682241c5d411740baf6e9920e4536abb..bd78f7687fcdbf0911b31ba463fca87870c6ff31 100644 (file)
@@ -581,17 +581,17 @@ static BOOL receive_getdc_response(struct in_addr dc_ip,
 static void dcip_to_name( const char *domainname, const char *realm, 
                           const DOM_SID *sid, struct in_addr ip, fstring name )
 {
-       int i;
 
        /* try GETDC requests first */
        
-       send_getdc_request(ip, domainname, sid);
-       smb_msleep(100);
-
-       for (i=0; i<5; i++) {
-               if (receive_getdc_response(ip, domainname, name))
-                       return;
-               smb_msleep(500);
+       if (send_getdc_request(ip, domainname, sid)) {
+               int i;
+               smb_msleep(100);
+               for (i=0; i<5; i++) {
+                       if (receive_getdc_response(ip, domainname, name))
+                               return;
+                       smb_msleep(500);
+               }
        }
 
        /* try node status request */