Skip to content

Commit b8e629b

Browse files
vladimirolteanPaolo Abeni
authored andcommitted
selftests: forwarding: fix flood_unicast_test when h2 supports IFF_UNICAST_FLT
As mentioned in the blamed commit, flood_unicast_test() works by checking the match count on a tc filter placed on the receiving interface. But the second host interface (host2_if) has no interest in receiving a packet with MAC DA de:ad:be:ef:13:37, so its RX filter drops it even before the ingress tc filter gets to be executed. So we will incorrectly get the message "Packet was not flooded when should", when in fact, the packet was flooded as expected but dropped due to an unrelated reason, at some other layer on the receiving side. Force h2 to accept this packet by temporarily placing it in promiscuous mode. Alternatively we could either deliver to its MAC address or use tcpdump_start, but this has the fewest complications. This fixes the "flooding" test from bridge_vlan_aware.sh and bridge_vlan_unaware.sh, which calls flood_test from the lib. Fixes: 236dd50 ("selftests: forwarding: Add a test for flooded traffic") Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Tested-by: Ido Schimmel <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 7e8c182 commit b8e629b

File tree

1 file changed

+2
-0
lines changed
  • tools/testing/selftests/net/forwarding

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,7 @@ flood_test_do()
13061306

13071307
# Add an ACL on `host2_if` which will tell us whether the packet
13081308
# was flooded to it or not.
1309+
ip link set $host2_if promisc on
13091310
tc qdisc add dev $host2_if ingress
13101311
tc filter add dev $host2_if ingress protocol ip pref 1 handle 101 \
13111312
flower dst_mac $mac action drop
@@ -1323,6 +1324,7 @@ flood_test_do()
13231324

13241325
tc filter del dev $host2_if ingress protocol ip pref 1 handle 101 flower
13251326
tc qdisc del dev $host2_if ingress
1327+
ip link set $host2_if promisc off
13261328

13271329
return $err
13281330
}

0 commit comments

Comments
 (0)