when nmbd starts up it is possible that dhcp hasn't started the local
authorAndrew Tridgell <tridge@samba.org>
Wed, 19 Jun 2002 00:21:38 +0000 (00:21 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 19 Jun 2002 00:21:38 +0000 (00:21 +0000)
interfaces yet. Instead of giving up, nmbd will now wait for some
interfaces to appear

source/nmbd/nmbd_subnetdb.c

index 6c6e7adbb8e077497ba457d400f69c9c1c854e18..146b6cbdfe3c5228b7bdaa9d1419b73370ca774f 100644 (file)
@@ -233,12 +233,17 @@ BOOL create_subnets(void)
   struct in_addr unicast_ip, ipzero;
   extern struct in_addr loopback_ip;
 
-  if(num_interfaces == 0)
-  {
-    DEBUG(0,("create_subnets: No local interfaces !\n"));
-    return False;
+  if(num_interfaces == 0) {
+         DEBUG(0,("create_subnets: No local interfaces !\n"));
+         DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n"));
+         while (iface_count() == 0) {
+                 sleep(5);
+                 load_interfaces();
+         }
   }
 
+  num_interfaces = iface_count();
+
   /* 
    * Create subnets from all the local interfaces and thread them onto
    * the linked list.