Additional fix for nmbd and 127.0.0.1 interface.
authorJeremy Allison <jra@samba.org>
Mon, 3 Apr 2000 17:11:55 +0000 (17:11 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 3 Apr 2000 17:11:55 +0000 (17:11 +0000)
Jeremy.

source/nmbd/nmbd_subnetdb.c

index 37b50f85250b952a0d2af92868e36da546c47e44..330be4057f1320207212c31c373194d0e7a858ae 100644 (file)
@@ -235,6 +235,7 @@ BOOL create_subnets(void)
   int num_interfaces = iface_count();
   int i;
   struct in_addr unicast_ip;
+  extern struct in_addr loopback_ip;
 
   if(num_interfaces == 0)
   {
@@ -251,6 +252,17 @@ BOOL create_subnets(void)
   {
     struct interface *iface = get_interface(i);
 
+    /*
+     * We don't want to add a loopback interface, in case
+     * someone has added 127.0.0.1 for smbd, nmbd needs to
+     * ignore it here. JRA.
+     */
+
+    if (ip_equal(iface->ip, loopback_ip)) {
+      DEBUG(2,("create_subnets: Ignoring loopback interface.\n" ));
+      continue;
+    }
+
     if (!make_normal_subnet(iface)) return False;
   }