From 8833307a027a43d469b1f93eaab1bf0e7f0b1615 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 9 Aug 2025 20:24:29 +0200 Subject: [PATCH] client: keep "configure med fast-start" working People should now use "configure lldp fast-start", but we keep the previous configuration working as well. Add an entry in NEWS. Fix #680 (well, previous commit did) --- NEWS | 1 + src/client/client.h | 1 + src/client/conf-lldp.c | 6 +++--- src/client/conf-med.c | 3 +++ tests/integration/test_lldpcli.py | 19 +++++++++++++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index ce2aaede..3bb849f7 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ lldpd (1.0.20) * Fix: + Do not break zero-copy traffic on Linux (#732 and #733) + Fix crash on rapid addition/removal of interfaces (#744) + + Enable fast start unconditionally (and move its configuration in "configure lldp") (#683) lldpd (1.0.19) * Changes: diff --git a/src/client/client.h b/src/client/client.h index 763b9a1b..bc0b8de1 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -144,6 +144,7 @@ void register_commands_configure_inventory(struct cmd_node *, struct cmd_node *) void register_commands_configure_dot3(struct cmd_node *); void register_commands_medpow(struct cmd_node *); void register_commands_dot3pow(struct cmd_node *); +void register_commands_faststart(struct cmd_node *, struct cmd_node *); /* tokenizer.c */ int tokenize_line(const char *, int *, char ***); diff --git a/src/client/conf-lldp.c b/src/client/conf-lldp.c index e883c553..576aff1c 100644 --- a/src/client/conf-lldp.c +++ b/src/client/conf-lldp.c @@ -55,8 +55,8 @@ cmd_faststart(struct lldpctl_conn_t *conn, struct writer *w, struct cmd_env *env return 1; } -static void -register_commands_fast_start(struct cmd_node *configure_lldp, struct cmd_node *unconfigure_lldp) +void +register_commands_faststart(struct cmd_node *configure_lldp, struct cmd_node *unconfigure_lldp) { struct cmd_node *configure_fast = commands_new(configure_lldp, "fast-start", "Fast start configuration", cmd_check_no_env, NULL, "ports"); @@ -676,7 +676,7 @@ register_commands_configure_lldp(struct cmd_node *configure, struct cmd_node *unconfigure_lldp = commands_new(unconfigure, "lldp", "LLDP configuration", NULL, NULL, NULL); - register_commands_fast_start(configure_lldp, unconfigure_lldp); + register_commands_faststart(configure_lldp, unconfigure_lldp); commands_new( commands_new(commands_new(configure_lldp, "tx-interval", diff --git a/src/client/conf-med.c b/src/client/conf-med.c index bb3797a7..1460daee 100644 --- a/src/client/conf-med.c +++ b/src/client/conf-med.c @@ -427,8 +427,11 @@ register_commands_configure_med(struct cmd_node *configure, struct cmd_node *configure_med = commands_new(configure, "med", "MED configuration", NULL, NULL, NULL); + struct cmd_node *unconfigure_med = + commands_new(unconfigure, "med", "MED configuration", NULL, NULL, NULL); register_commands_medloc(configure_med); register_commands_medpol(configure_med); register_commands_medpow(configure_med); + register_commands_faststart(configure_med, unconfigure_med); } diff --git a/tests/integration/test_lldpcli.py b/tests/integration/test_lldpcli.py index 30d0a4e9..4e9262d7 100644 --- a/tests/integration/test_lldpcli.py +++ b/tests/integration/test_lldpcli.py @@ -692,6 +692,25 @@ def test_return_code(lldpd1, lldpcli, namespaces): ("configure lldp portidsubtype ifname", "lldp-portid-type", "ifname"), ("unconfigure lldp fast-start", "fast-start", "no"), ("configure lldp fast-start tx-interval 2", "fast-start-interval", 2), + # the two next ones are deprecated + pytest.param( + "unconfigure med fast-start", + "fast-start", + "no", + marks=pytest.mark.skipif( + "'LLDP-MED' not in config.lldpd.features", + reason="LLDP-MED not supported", + ), + ), + pytest.param( + "configure med fast-start tx-interval 2", + "fast-start-interval", + 2, + marks=pytest.mark.skipif( + "'LLDP-MED' not in config.lldpd.features", + reason="LLDP-MED not supported", + ), + ), ("configure system interface pattern eth*", "iface-pattern", "eth*"), ("configure system interface permanent eth*", "perm-iface-pattern", "eth*"), ("configure system ip management pattern 10.*", "mgmt-pattern", "10.*"), -- 2.47.2