]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
client: fix global tx hold and interval setting
authorHangbin Liu <liuhangbin@gmail.com>
Mon, 2 Dec 2024 06:34:44 +0000 (14:34 +0800)
committerVincent Bernat <vincent@bernat.ch>
Sat, 7 Dec 2024 11:38:18 +0000 (12:38 +0100)
In the following fixed commit, I forgot to fix the transmission (tx) hold
and interval range in the global configuration setting.

Fixes: 7b9abb819337 ("client: add range restriction for tx hold and interval")
Reported-by: Fei Liu <feliu@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
src/daemon/client.c

index 2112bdea6beff6448ad351b733c272cbd2d6810d..091e1f4e4648ede02f2a2f3726b4fc5773dcd83e 100644 (file)
@@ -75,7 +75,7 @@ client_handle_set_configuration(struct lldpd *cfg, enum hmsg_type *type, void *i
        if (CHANGED(c_tx_interval) && config->c_tx_interval != 0) {
                if (config->c_tx_interval < 0) {
                        log_debug("rpc", "client asked for immediate retransmission");
-               } else {
+               } else if (config->c_tx_interval <= 3600 * 1000) {
                        log_debug("rpc", "client change transmit interval to %d ms",
                            config->c_tx_interval);
                        cfg->g_config.c_tx_interval = config->c_tx_interval;
@@ -86,7 +86,8 @@ client_handle_set_configuration(struct lldpd *cfg, enum hmsg_type *type, void *i
                }
                levent_send_now(cfg);
        }
-       if (CHANGED(c_tx_hold) && config->c_tx_hold > 0) {
+       if (CHANGED(c_tx_hold) && config->c_tx_hold > 0 &&
+           config->c_tx_hold <= 100) {
                log_debug("rpc", "client change transmit hold to %d",
                    config->c_tx_hold);
                cfg->g_config.c_tx_hold = config->c_tx_hold;