]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
client: keep "configure med fast-start" working master
authorVincent Bernat <vincent@bernat.ch>
Sat, 9 Aug 2025 18:24:29 +0000 (20:24 +0200)
committerVincent Bernat <vincent@bernat.ch>
Sat, 9 Aug 2025 18:28:57 +0000 (20:28 +0200)
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
src/client/client.h
src/client/conf-lldp.c
src/client/conf-med.c
tests/integration/test_lldpcli.py

diff --git a/NEWS b/NEWS
index ce2aaedea6d8783828f1acc7c340a06e56552687..3bb849f7becbb2e13f18ff9248dd38cf2f783866 100644 (file)
--- 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:
index 763b9a1b0f8dc71d31da061d8e06c65bf401640d..bc0b8de101634c39eed513bc821a8c792196e6f5 100644 (file)
@@ -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 ***);
index e883c5535b9376e7d954d60ae7d3190dcac5eb92..576aff1c74b5e9f57bb18ffde3d7668b2ea72055 100644 (file)
@@ -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",
index bb3797a78c3da8df51ee6f4cb2d51d4e04f8b09d..1460daeec5aa45adaf4587cb543940b4b4776ec8 100644 (file)
@@ -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);
 }
index 30d0a4e916735ca56acbccda6c6996209e760ec4..4e9262d7629059f5d1699699f6f21846b4a37b90 100644 (file)
@@ -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.*"),