]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: forwarding: fix flood_unicast_test when h2 supports IFF_UNICAST_FLT
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 3 Jul 2022 07:36:24 +0000 (10:36 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 5 Jul 2022 09:52:33 +0000 (11:52 +0200)
commita5023c51d31c764594b1f28664fd5c17eb81e87d
treef6c1f4139a1246d38fe81ecf4388851756372c42
parentff00f0562ef2eac8af86fe11a6fb6ccb0e5af9fd
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: fa2f5cb33e8e ("selftests: forwarding: Add a test for flooded traffic")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/forwarding/lib.sh