s3: nmbd: Stop nmbd network announce storm.
authorAndrew Bartlett <abartlet@samba.org>
Mon, 17 Sep 2018 19:45:14 +0000 (12:45 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 19 Sep 2018 20:25:05 +0000 (22:25 +0200)
Correct fix for. On announce, work->lastannounce_time is set
to current time t, so we must check that 't >= work->lastannounce_time',
not 't > work->lastannounce_time' otherwise we end up not
doing the comparison, and always doing the announce.

Reported by Reuben Farrelly

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13620

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Revviewe-by: Andreas Schneider <asn@samba.org>
source3/nmbd/nmbd_sendannounce.c

index 44d67e7ca843da6f5142883e0524b83de45e1227..a9cdf1c5a5833a8bd146ea084be9ed3cfc8fa75c 100644 (file)
@@ -288,7 +288,7 @@ void announce_my_server_names(time_t t)
                        }
 
                        /* Announce every minute at first then progress to every 12 mins */
-                       if (t > work->lastannounce_time &&
+                       if (t >= work->lastannounce_time &&
                            (t - work->lastannounce_time) < work->announce_interval) {
                                continue;
                        }