diff options
author | Jeremy Allison <jra@samba.org> | 2008-08-19 17:30:30 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-08-19 17:30:30 -0700 |
commit | f23a6b7c93a419d70889f06b7b3ab18725399793 (patch) | |
tree | 32e368f9960e5d6b07a9127a8134fc1651b94a4a /source3/nmbd | |
parent | 477e6bb40d83dc53829cd8bdbb15ca9759872ca5 (diff) | |
download | samba-f23a6b7c93a419d70889f06b7b3ab18725399793.tar.gz samba-f23a6b7c93a419d70889f06b7b3ab18725399793.tar.xz samba-f23a6b7c93a419d70889f06b7b3ab18725399793.zip |
Fix bug 5697 nmbd spins in reload_interfaces when only loopback has an IPv4 address
reported by Ted Percival <ted@midg3t.net>.
Jeremy.
(This used to be commit ab06efccf31fbc899536d2681a2076e6dfd65b9e)
Diffstat (limited to 'source3/nmbd')
-rw-r--r-- | source3/nmbd/nmbd.c | 4 | ||||
-rw-r--r-- | source3/nmbd/nmbd_subnetdb.c | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 83005f05bda..d9f2af4c10b 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -296,8 +296,8 @@ static void reload_interfaces(time_t t) BlockSignals(false, SIGTERM); - /* We only count IPv4 interfaces here. */ - while (iface_count_v4() == 0 && !got_sig_term) { + /* We only count IPv4, non-loopback interfaces here. */ + while (iface_count_v4_nl() == 0 && !got_sig_term) { sleep(5); load_interfaces(); } diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c index a4422d27d57..225def52cce 100644 --- a/source3/nmbd/nmbd_subnetdb.c +++ b/source3/nmbd/nmbd_subnetdb.c @@ -195,19 +195,20 @@ struct subnet_record *make_normal_subnet(const struct interface *iface) bool create_subnets(void) { /* We only count IPv4 interfaces whilst we're waiting. */ - int num_interfaces = iface_count_v4(); + int num_interfaces; int i; struct in_addr unicast_ip, ipzero; try_interfaces_again: - if (iface_count_v4() == 0) { - DEBUG(0,("create_subnets: No local interfaces !\n")); + /* Only count IPv4, non-loopback interfaces. */ + if (iface_count_v4_nl() == 0) { + DEBUG(0,("create_subnets: No local IPv4 non-loopback interfaces !\n")); DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n")); } - /* We only count IPv4 interfaces here. */ - while (iface_count_v4() == 0) { + /* We only count IPv4, non-loopback interfaces here. */ + while (iface_count_v4_nl() == 0) { void (*saved_handler)(int); /* |