selftests: mptcp: sockopt: skip TCP_INQ checks if not supported
commit b631e3a4e94c77c9007d60b577a069c203ce9594 upstream. Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is TCP_INQ cmsg support introduced in commit2c9e77659a("mptcp: add TCP_INQ cmsg support"). It is possible to look for "mptcp_ioctl" in kallsyms because it was needed to introduce the mentioned feature. We can skip these tests and not set TCPINQ option if the feature is not supported. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes:5cbd886ce2("selftests: mptcp: add TCP_INQ support") 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: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
157dcb2000
commit
bce23d1254
1 changed files with 12 additions and 2 deletions
|
|
@ -182,9 +182,14 @@ do_transfer()
|
||||||
local_addr="0.0.0.0"
|
local_addr="0.0.0.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cmsg="TIMESTAMPNS"
|
||||||
|
if mptcp_lib_kallsyms_has "mptcp_ioctl$"; then
|
||||||
|
cmsg+=",TCPINQ"
|
||||||
|
fi
|
||||||
|
|
||||||
timeout ${timeout_test} \
|
timeout ${timeout_test} \
|
||||||
ip netns exec ${listener_ns} \
|
ip netns exec ${listener_ns} \
|
||||||
$mptcp_connect -t ${timeout_poll} -l -M 1 -p $port -s ${srv_proto} -c TIMESTAMPNS,TCPINQ \
|
$mptcp_connect -t ${timeout_poll} -l -M 1 -p $port -s ${srv_proto} -c "${cmsg}" \
|
||||||
${local_addr} < "$sin" > "$sout" &
|
${local_addr} < "$sin" > "$sout" &
|
||||||
spid=$!
|
spid=$!
|
||||||
|
|
||||||
|
|
@ -192,7 +197,7 @@ do_transfer()
|
||||||
|
|
||||||
timeout ${timeout_test} \
|
timeout ${timeout_test} \
|
||||||
ip netns exec ${connector_ns} \
|
ip netns exec ${connector_ns} \
|
||||||
$mptcp_connect -t ${timeout_poll} -M 2 -p $port -s ${cl_proto} -c TIMESTAMPNS,TCPINQ \
|
$mptcp_connect -t ${timeout_poll} -M 2 -p $port -s ${cl_proto} -c "${cmsg}" \
|
||||||
$connect_addr < "$cin" > "$cout" &
|
$connect_addr < "$cin" > "$cout" &
|
||||||
|
|
||||||
cpid=$!
|
cpid=$!
|
||||||
|
|
@ -311,6 +316,11 @@ do_tcpinq_tests()
|
||||||
ip netns exec "$ns1" iptables -F
|
ip netns exec "$ns1" iptables -F
|
||||||
ip netns exec "$ns1" ip6tables -F
|
ip netns exec "$ns1" ip6tables -F
|
||||||
|
|
||||||
|
if ! mptcp_lib_kallsyms_has "mptcp_ioctl$"; then
|
||||||
|
echo "INFO: TCP_INQ not supported: SKIP"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
for args in "-t tcp" "-r tcp"; do
|
for args in "-t tcp" "-r tcp"; do
|
||||||
do_tcpinq_test $args
|
do_tcpinq_test $args
|
||||||
lret=$?
|
lret=$?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue