summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-03-29 21:30:52 +0000
committerJeremy Allison <jra@samba.org>2000-03-29 21:30:52 +0000
commit99665730764d825924b961cb4e39dbff2ed550b3 (patch)
treed1f69615d3cc81ad92377da374811f9df9b33447 /source3
parentc475ab51d99ee3aa33f9d2c6eaa2811f2f8ea931 (diff)
downloadsamba-99665730764d825924b961cb4e39dbff2ed550b3.tar.gz
samba-99665730764d825924b961cb4e39dbff2ed550b3.tar.xz
samba-99665730764d825924b961cb4e39dbff2ed550b3.zip
Cause nmbd to ignore loopback interface when constructing its interface list. This is done by default when interfaces are probed, but if someone
explicitly adds 127.0.0.1 to the interfaces line for smbd, then nmbd would start to try and register names on it. This was not good :-(. Jeremy. (This used to be commit cc3ad825214686ad03dd4176d0c55290d1de6221)
Diffstat (limited to 'source3')
-rw-r--r--source3/nmbd/nmbd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index a7cf7560b38..57d025c6604 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -192,6 +192,7 @@ static void reload_interfaces(time_t t)
int n;
struct subnet_record *subrec;
extern BOOL rescan_listen_set;
+ extern struct in_addr loopback_ip;
if (t && ((t - lastt) < NMBD_INTERFACES_RELOAD)) return;
lastt = t;
@@ -205,10 +206,23 @@ static void reload_interfaces(time_t t)
/* find any interfaces that need adding */
for (n=iface_count() - 1; n >= 0; n--) {
struct interface *iface = get_interface(n);
+
+ /*
+ * 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,("reload_interfaces: Ignoring loopback interface %s\n", inet_ntoa(iface->ip)));
+ continue;
+ }
+
for (subrec=subnetlist; subrec; subrec=subrec->next) {
if (ip_equal(iface->ip, subrec->myip) &&
ip_equal(iface->nmask, subrec->mask_ip)) break;
}
+
if (!subrec) {
/* it wasn't found! add it */
DEBUG(2,("Found new interface %s\n",