Skip to content

Commit f67e9ae

Browse files
pmachatakuba-moo
authored andcommitted
selftests: bridge_fdb_local_vlan_0: Test FDB vs. NET_ADDR_SET behavior
The previous patch fixed an issue whereby no FDB entry would be created for the bridge itself on VLAN 0 under some circumstances. This could break forwarding. Add a test for the fix. Signed-off-by: Petr Machata <[email protected]> Acked-by: Nikolay Aleksandrov <[email protected]> Link: https://patch.msgid.link/137cc25396f5a4f407267af895a14bc45552ba5f.1758550408.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent cd9a956 commit f67e9ae

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

tools/testing/selftests/net/forwarding/bridge_fdb_local_vlan_0.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ALL_TESTS="
2727
test_d_sharing
2828
test_q_no_sharing
2929
test_q_sharing
30+
test_addr_set
3031
"
3132

3233
NUM_NETIFS=6
@@ -110,13 +111,10 @@ setup_prepare()
110111
switch_create
111112
}
112113

113-
adf_bridge_create()
114+
adf_bridge_configure()
114115
{
115116
local dev
116-
local mac
117117

118-
ip_link_add br up type bridge vlan_default_pvid 0 "$@"
119-
mac=$(mac_get br)
120118
ip_addr_add br 192.0.2.3/28
121119
ip_addr_add br 2001:db8:1::3/64
122120

@@ -130,7 +128,15 @@ adf_bridge_create()
130128
bridge_vlan_add dev "$dev" vid 2
131129
bridge_vlan_add dev "$dev" vid 3
132130
done
131+
}
132+
133+
adf_bridge_create()
134+
{
135+
local mac
133136

137+
ip_link_add br up type bridge vlan_default_pvid 0 "$@"
138+
mac=$(mac_get br)
139+
adf_bridge_configure
134140
ip_link_set_addr br "$mac"
135141
}
136142

@@ -367,6 +373,20 @@ test_q_sharing()
367373
do_test_sharing 1
368374
}
369375

376+
adf_addr_set_bridge_create()
377+
{
378+
ip_link_add br up type bridge vlan_filtering 0
379+
ip_link_set_addr br "$(mac_get br)"
380+
adf_bridge_configure
381+
}
382+
383+
test_addr_set()
384+
{
385+
adf_addr_set_bridge_create
386+
setup_wait
387+
388+
do_end_to_end_test "$(mac_get br)" "NET_ADDR_SET: end to end, br MAC"
389+
}
370390

371391
trap cleanup EXIT
372392

0 commit comments

Comments
 (0)