summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>1997-12-24 15:42:14 +0000
committerHerb Lewis <herb@samba.org>1997-12-24 15:42:14 +0000
commit7f49012b1d9f7f0bd00488fd2d2d3853f8403b60 (patch)
tree6cd728af48908ec23c2edff918a8f43b01edae2e /source3
parent0712d155b31e83834ec7e108d5c53a84adf634f3 (diff)
downloadsamba-7f49012b1d9f7f0bd00488fd2d2d3853f8403b60.tar.gz
samba-7f49012b1d9f7f0bd00488fd2d2d3853f8403b60.tar.bz2
samba-7f49012b1d9f7f0bd00488fd2d2d3853f8403b60.zip
This is actually Jeremy, working as Herb :-).
Fixed bug where, when server is shut down it would always do a lm announce broadcast of shutdown. This could cause other nmbd's to think that they have seen an lm announce broadcast and start doing it themselves. Changed to only send lm announce shutdown if admin configured it or one was seen on the subnet. Jeremy. (This used to be commit 64c8111574ff9fa00d5b43b146ae4d6f6bdf0565)
Diffstat (limited to 'source3')
-rw-r--r--source3/nmbd/nmbd_sendannounce.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/nmbd/nmbd_sendannounce.c b/source3/nmbd/nmbd_sendannounce.c
index aac3dad366..e859ff6bb7 100644
--- a/source3/nmbd/nmbd_sendannounce.c
+++ b/source3/nmbd/nmbd_sendannounce.c
@@ -430,7 +430,10 @@ This must *only* be called on shutdown.
void announce_my_servers_removed(void)
{
+ int announce_interval = lp_lm_interval();
+ int lm_announce = lp_lm_announce();
struct subnet_record *subrec;
+
for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec))
{
struct work_record *work;
@@ -447,6 +450,25 @@ void announce_my_servers_removed(void)
if(AM_LOCAL_MASTER_BROWSER(work))
send_local_master_announcement(subrec, work, servrec);
send_host_announcement(subrec, work, servrec);
+
+
+ if ((announce_interval <= 0) || (lm_announce <= 0))
+ {
+ /* user absolutely does not want LM announcements to be sent. */
+ continue;
+ }
+
+ if ((lm_announce >= 2) && (!found_lm_clients))
+ {
+ /* has been set to 2 (Auto) but no LM clients detected (yet). */
+ continue;
+ }
+
+ /*
+ * lm announce was set or we have seen lm announcements, so do
+ * a lm announcement of host removed.
+ */
+
send_lm_host_announcement(subrec, work, servrec, 0);
}
}