From: Hangbin Liu Date: Mon, 2 Dec 2024 06:34:44 +0000 (+0800) Subject: client: fix global tx hold and interval setting X-Git-Tag: 1.0.19~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7de43fe8b8993f01422cfc00dfb06bcaf5171eb0;p=thirdparty%2Flldpd.git client: fix global tx hold and interval setting 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 Signed-off-by: Hangbin Liu --- diff --git a/src/daemon/client.c b/src/daemon/client.c index 2112bdea..091e1f4e 100644 --- a/src/daemon/client.c +++ b/src/daemon/client.c @@ -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;