]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: forwarding: Fix failing tests with old libnet
authorIdo Schimmel <idosch@nvidia.com>
Tue, 9 Aug 2022 11:33:20 +0000 (14:33 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 11 Aug 2022 05:36:14 +0000 (22:36 -0700)
commit9c38be72d8b8129ada9e0156049c3551bef424a6
tree3797aa61784af5591639951616b1502e10f96687
parenta155bbc00bb0bf5d5d6f4af5753e1ef4415a57a0
selftests: forwarding: Fix failing tests with old libnet

The custom multipath hash tests use mausezahn in order to test how
changes in various packet fields affect the packet distribution across
the available nexthops.

The tool uses the libnet library for various low-level packet
construction and injection. The library started using the
"SO_BINDTODEVICE" socket option for IPv6 sockets in version 1.1.6 and
for IPv4 sockets in version 1.2.

When the option is not set, packets are not routed according to the
table associated with the VRF master device and tests fail.

Fix this by prefixing the command with "ip vrf exec", which will cause
the route lookup to occur in the VRF routing table. This makes the tests
pass regardless of the libnet library version.

Fixes: ae8682d4af30 ("selftests: forwarding: Add test for custom multipath hash")
Fixes: cd19532735a9 ("selftests: forwarding: Add test for custom multipath hash with IPv4 GRE")
Fixes: cb0ce26d90d3 ("selftests: forwarding: Add test for custom multipath hash with IPv6 GRE")
Reported-by: Ivan Vecera <ivecera@redhat.com>
Tested-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Link: https://lore.kernel.org/r/20220809113320.751413-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/custom_multipath_hash.sh
tools/testing/selftests/net/forwarding/gre_custom_multipath_hash.sh
tools/testing/selftests/net/forwarding/ip6gre_custom_multipath_hash.sh