selftests: mptcp: connect: skip transp tests if not supported
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Thu, 8 Jun 2023 16:38:44 +0000 (18:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jun 2023 09:12:18 +0000 (11:12 +0200)
commitcba0db9c158666efb84ae9e0da8e5965ce556379
treed7c8f876f9c59c6e071aea1b4f9097d480198aa3
parent9ead68270b29a9a2ee7b84242cd8e5da044fbd43
selftests: mptcp: connect: skip transp tests if not supported

commit 07bf49401909264a38fa3427c3cce43e8304436a upstream.

Selftests are supposed to run on any kernels, including the old ones not
supporting all MPTCP features.

One of them is the support of IP(V6)_TRANSPARENT socket option with
MPTCP connections introduced by commit c9406a23c116 ("mptcp: sockopt:
add SOL_IP freebind & transparent options").

It is possible to look for "__ip_sock_set_tos" in kallsyms because
IP(V6)_TRANSPARENT socket option support has been added after TOS
support which came with the required infrastructure in MPTCP sockopt
code. To support TOS, the following function has been exported (T). Not
great but better than checking for a specific kernel version.

Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368
Fixes: 5fb62e9cd3ad ("selftests: mptcp: add tproxy test case")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/net/mptcp/mptcp_connect.sh