selftests: fcnal: Test SO_DONTROUTE on TCP sockets.
authorGuillaume Nault <gnault@redhat.com>
Thu, 11 May 2023 14:39:32 +0000 (16:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 May 2023 08:43:56 +0000 (09:43 +0100)
commitdd017c72dde677cef5a5a965ca71ac4736b53452
treef92c3d4f00a0d2e32300b9906cd27748332127d4
parentaeefbb574c38025fd65a1b053c41595ba13b2408
selftests: fcnal: Test SO_DONTROUTE on TCP sockets.

Use nettest --{client,server}-dontroute to test the kernel behaviour
with TCP sockets having the SO_DONTROUTE option. Sending packets to a
neighbour (on link) host, should work. When the host is behind a
router, sending should fail.

Client and server sockets are tested independently, so that we can
cover different TCP kernel paths.

SO_DONTROUTE also affects the syncookies path. So ipv4_tcp_dontroute()
is made to work with or without syncookies, to cover both paths.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/fcnal-test.sh