Skip to content

Commit 04aeddf

Browse files
andrestcPaolo Abeni
authored andcommitted
selftests: netconsole: only restore MAC when it changed on resume
The "mac" bind mode reactivation downs the interface, restores the saved MAC and renames it to trigger a target resume. This assumes the recreated interface comes back with a different MAC, which is true under MACAddressPolicy=none (as on the Netdev CI) but not when MACs are persistent. In the persistent case netconsole resumes the target on its own, and the down/restore/rename flow instead drops it and fails the test. Guard the block on the MAC having actually changed so the test passes under both policies. Fixes: 6ecc083 ("selftests: netconsole: validate target resume") Reported-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Closes: https://lore.kernel.org/netdev/f398373e-2cb4-4649-a491-9763df94d98b@kernel.org/ Signed-off-by: Andre Carvalho <asantostc@gmail.com> Tested-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20260710-netcons-mac-reload-v1-1-3fb1bcc70b4a@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 1cb8553 commit 04aeddf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/testing/selftests/drivers/net/netconsole/netcons_resume.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ function trigger_reactivation() {
4444
# Restore MACs
4545
ip netns exec "${NAMESPACE}" ip link set "${DSTIF}" \
4646
address "${SAVED_DSTMAC}"
47-
if [ "${BINDMODE}" == "mac" ]; then
47+
if [ "${BINDMODE}" == "mac" ] &&
48+
[ "$(mac_get "${SRCIF}")" != "${SAVED_SRCMAC}" ]; then
4849
ip link set dev "${SRCIF}" down
4950
ip link set dev "${SRCIF}" address "${SAVED_SRCMAC}"
5051
# Rename device in order to trigger target resume, as initial

0 commit comments

Comments
 (0)