2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/tools/testing/selftests/net/tcp_ao
Dmitry Safonov e5ddf19dbc net/selftests: Add loopback link local route for self-connect
self-connect-ipv6 got slightly flaky on netdev:
> # timeout set to 120
> # selftests: net/tcp_ao: self-connect_ipv6
> # 1..5
> # # 708[lib/setup.c:250] rand seed 1742872572
> # TAP version 13
> # # 708[lib/proc.c:213]    Snmp6            Ip6OutNoRoutes: 0 => 1
> # not ok 1 # error 708[self-connect.c:70] failed to connect()
> # ok 2 No unexpected trace events during the test run
> # # Planned tests != run tests (5 != 2)
> # # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:1
> ok 1 selftests: net/tcp_ao: self-connect_ipv6

I can not reproduce it on my machines, but judging by "Ip6OutNoRoutes"
there is no route to the local_addr (::1).

Looking at the kernel code, I see that kernel does add link-local
address automatically in init_loopback(), but that is called from
ipv6 notifier block. So, in turn the userspace that brought up
the loopback interface may see rtnetlink ACK earlier than
addrconf_notify() does it's job (at least, on a slow VM such as netdev).
Probably, for ipv4 it's the same, judging by inetdev_event().

The fix is quite simple: set the link-local route straight after
bringing the loopback interface. That will make it synchronous.

Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Link: https://patch.msgid.link/20250402-tcp-ao-selfconnect-flake-v1-1-8388d629ef3d@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-03 15:08:31 -07:00
..
lib selftests/net: Drop timeout argument from test_client_verify() 2025-03-25 06:10:30 -07:00
.gitignore
bench-lookups.c selftests/net: Add trace events matching to tcp_ao 2024-08-27 14:11:27 -07:00
config selftests/net: Add trace events matching to tcp_ao 2024-08-27 14:11:27 -07:00
connect-deny.c selftests/net: Add mixed select()+polling mode to TCP-AO tests 2025-03-25 06:10:30 -07:00
connect.c selftests/net: Drop timeout argument from test_client_verify() 2025-03-25 06:10:30 -07:00
icmps-accept.c selftests/net: Add TCP-AO ICMPs accept test 2023-12-17 10:41:54 +00:00
icmps-discard.c selftests/net: Drop timeout argument from test_client_verify() 2025-03-25 06:10:30 -07:00
key-management.c selftests/net: Drop timeout argument from test_client_verify() 2025-03-25 06:10:30 -07:00
Makefile selftests/net: Add trace events matching to tcp_ao 2024-08-27 14:11:27 -07:00
restore.c selftests/net: Drop timeout argument from test_client_verify() 2025-03-25 06:10:30 -07:00
rst.c selftests/net: Drop timeout argument from test_client_verify() 2025-03-25 06:10:30 -07:00
self-connect.c net/selftests: Add loopback link local route for self-connect 2025-04-03 15:08:31 -07:00
seq-ext.c selftests/net: Drop timeout argument from test_client_verify() 2025-03-25 06:10:30 -07:00
setsockopt-closed.c selftest/tcp-ao: Add filter tests 2024-10-28 15:53:50 -07:00
settings selftests: tcp_ao: set the timeout to 2 minutes 2024-01-25 16:00:50 -08:00
unsigned-md5.c selftests/net: Print the testing side in unsigned-md5 2025-03-25 06:10:30 -07:00