]> git.puffer.fish Git - matthieu/frr.git/commitdiff
babled: set wired/wireless internal only when wired/wireless status changes
authorShbinging <bingshui@smail.nju.edu.cn>
Tue, 18 Mar 2025 02:35:16 +0000 (10:35 +0800)
committerShbinging <bingshui@smail.nju.edu.cn>
Tue, 18 Mar 2025 02:38:12 +0000 (10:38 +0800)
As stated in doc, interface's attributes such noninterfering/interfering are reset when the wired/wireless status of an interface is changed. If wired/wireless status is not changed, such as wired->wired, we should not reset internal attributes.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
babeld/babel_interface.c

index f17842366a3c21e7ea02d5e8ca7a91bc6ca04975..2e0a51dd8cc110e1d93235ee1f4fc66ad94ac4fc 100644 (file)
@@ -310,7 +310,8 @@ DEFPY (babel_set_wired,
     babel_ifp = babel_get_if_nfo(ifp);
 
     assert (babel_ifp != NULL);
-    babel_set_wired_internal(babel_ifp, no ? 0 : 1);
+    if ((CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? 1 : 0) != (no ? 0 : 1))
+        babel_set_wired_internal(babel_ifp, no ? 0 : 1);
     return CMD_SUCCESS;
 }
 
@@ -328,7 +329,8 @@ DEFPY (babel_set_wireless,
     babel_ifp = babel_get_if_nfo(ifp);
 
     assert (babel_ifp != NULL);
-    babel_set_wired_internal(babel_ifp, no ? 1 : 0);
+    if ((CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? 1 : 0) != (no ? 1 : 0))
+        babel_set_wired_internal(babel_ifp, no ? 1 : 0);
     return CMD_SUCCESS;
 }