diff options
author | Dmitry Safonov <dima@arista.com> | 2023-12-22 04:59:06 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-01-02 16:27:48 +0300 |
commit | 72cd9f8d5a9925fb8ccedaf9b42ccf5fc955a716 (patch) | |
tree | 262e1a2acdcec23b944bd2defdb3473a71d3611e /tools/testing/selftests/net/tcp_ao/bench-lookups.c | |
parent | a27359abc820c619c67e91241e75d045decbfdc2 (diff) | |
download | linux-72cd9f8d5a9925fb8ccedaf9b42ccf5fc955a716.tar.xz |
selftest/tcp-ao: Set routes in a proper VRF table id
In unsigned-md5 selftests ip_route_add() is not needed in
client_add_ip(): the route was pre-setup in __test_init() => link_init()
for subnet, rather than a specific ip-address.
Currently, __ip_route_add() mistakenly always sets VRF table
to RT_TABLE_MAIN - this seems to have sneaked in during unsigned-md5
tests debugging. That also explains, why ip_route_add_vrf() ignored
EEXIST, returned by fib6.
Yet, keep EEXIST ignoring in bench-lookups selftests as it's expected
that those selftests may add the same (duplicate) routes.
Reported-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/tcp_ao/bench-lookups.c')
-rw-r--r-- | tools/testing/selftests/net/tcp_ao/bench-lookups.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/tcp_ao/bench-lookups.c b/tools/testing/selftests/net/tcp_ao/bench-lookups.c index 7be8a7d9308c..a1e6e007c291 100644 --- a/tools/testing/selftests/net/tcp_ao/bench-lookups.c +++ b/tools/testing/selftests/net/tcp_ao/bench-lookups.c @@ -46,8 +46,10 @@ static void test_add_routes(union tcp_addr *ips, size_t ips_nr) for (i = 0; i < ips_nr; i++) { union tcp_addr *p = (union tcp_addr *)&ips[i]; + int err; - if (ip_route_add(veth_name, TEST_FAMILY, this_ip_addr, *p)) + err = ip_route_add(veth_name, TEST_FAMILY, this_ip_addr, *p); + if (err && err != -EEXIST) test_error("Failed to add route"); } } |