]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
client: fix "update" command
authorVincent Bernat <vincent@bernat.im>
Thu, 6 Nov 2014 18:15:20 +0000 (19:15 +0100)
committerVincent Bernat <vincent@bernat.im>
Thu, 6 Nov 2014 18:15:20 +0000 (19:15 +0100)
Commit e4c51716848a639daf61eff3e96ad242af3e316b broke this command
because we were checking for `tx_hold` instead of `tx_interval`. Let's
fix that.

src/daemon/client.c

index 2ac762fc5ee71acd6e6e74aaa5b12ec4161438a0..e8d2c1fa2fe4723b08f507744f71a1fa1870152f 100644 (file)
@@ -68,25 +68,25 @@ client_handle_set_configuration(struct lldpd *cfg, enum hmsg_type *type,
                (config->w && cfg->g_config.w && !strcmp(config->w, cfg->g_config.w))))
 
        /* What needs to be done? Transmit delay? */
-       if (CHANGED(c_tx_interval) && config->c_tx_interval > 0) {
-               log_debug("rpc", "client change transmit interval to %d",
-                       config->c_tx_interval);
-               cfg->g_config.c_tx_interval = config->c_tx_interval;
-               LOCAL_CHASSIS(cfg)->c_ttl = cfg->g_config.c_tx_interval *
-                       cfg->g_config.c_tx_hold;
-       }
-       if (CHANGED(c_tx_hold) && config->c_tx_hold != 0) {
+       if (CHANGED(c_tx_interval) && config->c_tx_interval != 0) {
                if (config->c_tx_interval < 0) {
                        log_debug("rpc", "client asked for immediate retransmission");
                        levent_send_now(cfg);
                } else {
-                       log_debug("rpc", "client change transmit hold to %d",
-                           config->c_tx_hold);
-                       cfg->g_config.c_tx_hold = config->c_tx_hold;
+                       log_debug("rpc", "client change transmit interval to %d",
+                           config->c_tx_interval);
+                       cfg->g_config.c_tx_interval = config->c_tx_interval;
                        LOCAL_CHASSIS(cfg)->c_ttl = cfg->g_config.c_tx_interval *
                            cfg->g_config.c_tx_hold;
                }
        }
+       if (CHANGED(c_tx_hold) && config->c_tx_hold > 0) {
+               log_debug("rpc", "client change transmit hold to %d",
+                   config->c_tx_hold);
+               cfg->g_config.c_tx_hold = config->c_tx_hold;
+               LOCAL_CHASSIS(cfg)->c_ttl = cfg->g_config.c_tx_interval *
+                   cfg->g_config.c_tx_hold;
+       }
        if (CHANGED(c_lldp_portid_type) &&
            config->c_lldp_portid_type > LLDP_PORTID_SUBTYPE_UNKNOWN &&
            config->c_lldp_portid_type <= LLDP_PORTID_SUBTYPE_MAX) {