]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpd: set a 30 seconds lower limit to the safeguard timer 379/head
authorJean-Pierre Tosoni <jp.tosoni@acksys.fr>
Wed, 22 Jan 2020 11:03:25 +0000 (12:03 +0100)
committerJean-Pierre Tosoni <jp.tosoni@acksys.fr>
Wed, 22 Jan 2020 11:11:00 +0000 (12:11 +0100)
This timer is a safeguard to refresh information about all networks
interfaces at regular interval, in case there was something wrong with
the event-based refresh.

When using milliseconds-grained tx-interval, this could happen several
times per second, which is not the intended use of the safeguard.

To quote Vincent Bernat:
"Minimal value of 30 seconds even if we don't have event-based
refresh (so outside the if). Most people have the event-based
refresh, so lowering the pace for the others should be pretty
invisible."

src/daemon/event.c

index c9bf04ab742dd239ac6cb6dbfff1c56f6c0d98e8..59a4ac0923f7824b9442ef21c6ea9f6f10cff7d0 100644 (file)
@@ -483,6 +483,8 @@ levent_update_and_send(evutil_socket_t fd, short what, void *arg)
        lldpd_loop(cfg);
        if (cfg->g_iface_event != NULL)
                interval_ms *= 20;
+       if (interval_ms < 30000)
+               interval_ms = 30000;
        tv.tv_sec = interval_ms / 1000;
        tv.tv_usec = (interval_ms % 1000) * 1000;
        event_add(cfg->g_main_loop, &tv);