Skip to content

Commit 6af2af8

Browse files
committedMar 18, 2025
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 <bingshui@smail.nju.edu.cn>
1 parent c288e5f commit 6af2af8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎babeld/babel_interface.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ DEFPY (babel_set_wired,
310310
babel_ifp = babel_get_if_nfo(ifp);
311311

312312
assert (babel_ifp != NULL);
313-
babel_set_wired_internal(babel_ifp, no ? 0 : 1);
313+
if ((CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? 1 : 0) != (no ? 0 : 1))
314+
babel_set_wired_internal(babel_ifp, no ? 0 : 1);
314315
return CMD_SUCCESS;
315316
}
316317

@@ -328,7 +329,8 @@ DEFPY (babel_set_wireless,
328329
babel_ifp = babel_get_if_nfo(ifp);
329330

330331
assert (babel_ifp != NULL);
331-
babel_set_wired_internal(babel_ifp, no ? 1 : 0);
332+
if ((CHECK_FLAG(babel_ifp->flags, BABEL_IF_WIRED) ? 1 : 0) != (no ? 1 : 0))
333+
babel_set_wired_internal(babel_ifp, no ? 1 : 0);
332334
return CMD_SUCCESS;
333335
}
334336

0 commit comments

Comments
 (0)
Please sign in to comment.