Skip to content

Commit 9a169c2

Browse files
idoschkuba-moo
authored andcommitted
selftests: test_bridge_neigh_suppress.sh: Fix failures due to duplicate MAC
When creating the topology for the test, three veth pairs are created in the initial network namespace before being moved to one of the network namespaces created by the test. On systems where systemd-udev uses MACAddressPolicy=persistent (default since systemd version 242), this will result in some net devices having the same MAC address since they were created with the same name in the initial network namespace. In turn, this leads to arping / ndisc6 failing since packets are dropped by the bridge's loopback filter. Fix by creating each net device in the correct network namespace instead of moving it there from the initial network namespace. Reported-by: Jakub Kicinski <[email protected]> Closes: https://lore.kernel.org/netdev/[email protected]/ Fixes: 7648ac7 ("selftests: net: Add bridge neighbor suppression test") Signed-off-by: Ido Schimmel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4e13d3a commit 9a169c2

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

tools/testing/selftests/net/test_bridge_neigh_suppress.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,9 @@ setup_topo()
154154
setup_topo_ns $ns
155155
done
156156

157-
ip link add name veth0 type veth peer name veth1
158-
ip link set dev veth0 netns $h1 name eth0
159-
ip link set dev veth1 netns $sw1 name swp1
160-
161-
ip link add name veth0 type veth peer name veth1
162-
ip link set dev veth0 netns $sw1 name veth0
163-
ip link set dev veth1 netns $sw2 name veth0
164-
165-
ip link add name veth0 type veth peer name veth1
166-
ip link set dev veth0 netns $h2 name eth0
167-
ip link set dev veth1 netns $sw2 name swp1
157+
ip -n $h1 link add name eth0 type veth peer name swp1 netns $sw1
158+
ip -n $sw1 link add name veth0 type veth peer name veth0 netns $sw2
159+
ip -n $h2 link add name eth0 type veth peer name swp1 netns $sw2
168160
}
169161

170162
setup_host_common()

0 commit comments

Comments
 (0)