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.
void announce_my_servers_removed(void)
{
void announce_my_servers_removed(void)
{
+ int announce_interval = lp_lm_interval();
+ int lm_announce = lp_lm_announce();
struct subnet_record *subrec;
struct subnet_record *subrec;
for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec))
{
struct work_record *work;
for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec))
{
struct work_record *work;
if(AM_LOCAL_MASTER_BROWSER(work))
send_local_master_announcement(subrec, work, servrec);
send_host_announcement(subrec, work, servrec);
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);
}
}
send_lm_host_announcement(subrec, work, servrec, 0);
}
}