This is a note to let you know that I've just added the patch titled selftests: mptcp: sockopt: use 'iptables-legacy' if available to the 6.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: selftests-mptcp-sockopt-use-iptables-legacy-if-available.patch and it can be found in the queue-6.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From a5a5990c099dd354e05e89ee77cd2dbf6655d4a1 Mon Sep 17 00:00:00 2001 From: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> Date: Tue, 4 Jul 2023 22:44:36 +0200 Subject: selftests: mptcp: sockopt: use 'iptables-legacy' if available From: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> commit a5a5990c099dd354e05e89ee77cd2dbf6655d4a1 upstream. IPTables commands using 'iptables-nft' fail on old kernels, at least on v5.15 because it doesn't see the default IPTables chains: $ iptables -L iptables/1.8.2 Failed to initialize nft: Protocol not supported As a first step before switching to NFTables, we can use iptables-legacy if available. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: dc65fe82fb07 ("selftests: mptcp: add packet mark test case") Cc: stable@xxxxxxxxxxxxxxx Acked-by: Paolo Abeni <pabeni@xxxxxxxxxx> Signed-off-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -12,6 +12,8 @@ ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) mptcp_connect="" +iptables="iptables" +ip6tables="ip6tables" sec=$(date +%s) rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) @@ -25,7 +27,7 @@ add_mark_rules() local m=$2 local t - for t in iptables ip6tables; do + for t in ${iptables} ${ip6tables}; do # just to debug: check we have multiple subflows connection requests ip netns exec $ns $t -A OUTPUT -p tcp --syn -m mark --mark $m -j ACCEPT @@ -95,14 +97,14 @@ if [ $? -ne 0 ];then exit $ksft_skip fi -iptables -V > /dev/null 2>&1 -if [ $? -ne 0 ];then +# Use the legacy version if available to support old kernel versions +if iptables-legacy -V &> /dev/null; then + iptables="iptables-legacy" + ip6tables="ip6tables-legacy" +elif ! iptables -V &> /dev/null; then echo "SKIP: Could not run all tests without iptables tool" exit $ksft_skip -fi - -ip6tables -V > /dev/null 2>&1 -if [ $? -ne 0 ];then +elif ! ip6tables -V &> /dev/null; then echo "SKIP: Could not run all tests without ip6tables tool" exit $ksft_skip fi @@ -112,10 +114,10 @@ check_mark() local ns=$1 local af=$2 - local tables=iptables + local tables=${iptables} if [ $af -eq 6 ];then - tables=ip6tables + tables=${ip6tables} fi local counters values Patches currently in stable-queue which might be from matthieu.baerts@xxxxxxxxxxxx are queue-6.4/selftests-mptcp-depend-on-syn_cookies.patch queue-6.4/mptcp-do-not-rely-on-implicit-state-check-in-mptcp_listen.patch queue-6.4/mptcp-ensure-subflow-is-unhashed-before-cleaning-the-backlog.patch queue-6.4/selftests-mptcp-connect-fail-if-nft-supposed-to-work.patch queue-6.4/selftests-mptcp-userspace_pm-report-errors-with-remove-tests.patch queue-6.4/selftests-mptcp-pm_nl_ctl-fix-32-bit-support.patch queue-6.4/selftests-mptcp-userspace_pm-use-correct-server-port.patch queue-6.4/selftests-mptcp-sockopt-return-error-if-wrong-mark.patch queue-6.4/selftests-mptcp-sockopt-use-iptables-legacy-if-available.patch