selftests: forwarding: tc_flower_l2_miss: Fix failing test with old libnet
authorIdo Schimmel <idosch@nvidia.com>
Tue, 8 Aug 2023 14:15:00 +0000 (17:15 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Aug 2023 21:53:36 +0000 (14:53 -0700)
commit21a72166abb9c9d13fe24a07cef0a0b9f1e331b0
treed00b402ebff2f20187e8c4659d25b12436c32181
parent11604178fdc3404d46518e5332f1fe865d30c4a1
selftests: forwarding: tc_flower_l2_miss: Fix failing test with old libnet

As explained in commit 8bcfb4ae4d97 ("selftests: forwarding: Fix failing
tests with old libnet"), old versions of libnet (used by mausezahn) do
not use the "SO_BINDTODEVICE" socket option. For IP unicast packets,
this can be solved by prefixing mausezahn invocations with "ip vrf
exec". However, IP multicast packets do not perform routing and simply
egress the bound device, which does not exist in this case.

Fix by specifying the source and destination MAC of the packet which
will cause mausezahn to use a packet socket instead of an IP socket.

Fixes: 8c33266ae26a ("selftests: forwarding: Add layer 2 miss test cases")
Reported-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/20230808141503.4060661-15-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/tc_flower_l2_miss.sh