]> 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)
commitdd08f8028a146189671718fa1ce8c2b4d44a17c8
tree3797aa61784af5591639951616b1502e10f96687
parentee389a9c84e184903cde0809cc7d075dc0e22290
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: bdd958bd469e ("selftests: forwarding: Add test for custom multipath hash")
Fixes: 3181cd117985 ("selftests: forwarding: Add test for custom multipath hash with IPv4 GRE")
Fixes: 31b015a8befa ("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