From 6af2af83be3473c903b469ca4fae9eefa3035138 Mon Sep 17 00:00:00 2001 From: Shbinging Date: Tue, 18 Mar 2025 10:35:16 +0800 Subject: [PATCH] babled: set wired/wireless internal only when wired/wireless status changes 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 --- babeld/babel_interface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index f17842366a..2e0a51dd8c 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -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; } -- 2.39.5