From patchwork Thu Jan 9 13:32:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang Yan X-Patchwork-Id: 13932555 X-Patchwork-Delegate: geliang@kernel.org Received: from out162-62-58-211.mail.qq.com (out162-62-58-211.mail.qq.com [162.62.58.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36762219A65 for ; Thu, 9 Jan 2025 13:37:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.62.58.211 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736429842; cv=none; b=Iw3OCcNUZuawG9FWx+ODPGShE33wHEIU78KlPwDjJi5OYROwCFzdOQqvytaoD0lBErtz5WXhfYQCE4ucv3HgM9WORTg5uUSqCHvLW8o54hOkxz8JiHvqmod2RBud5p83zqGqWxtHmB6qJ3KvDevX781epTZxRayo29QszjBFyUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736429842; c=relaxed/simple; bh=2WYEwCTss8IgkXwkP3iYLiWEWpLaLvJruKuGXe1mZRg=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=o9Oafz53gC2FlOAv1AfrguV2vnNDhX5oOrRLbhsoecDhWHFHxU2QTvnR3Wn05SYS+dKudFaIoM+X5H6kA29PwzBxHJzyMcYnJlt6mWyyQI/fDqMj7YjBLQe84USfuuSFFMUur8f1vVs91CW9g6PVfvMCrQ+qo7QRPpxOlR5ACio= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b=fsCpYvPH; arc=none smtp.client-ip=162.62.58.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="fsCpYvPH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1736429532; bh=l+gd8rFXgSbheS046NCPtUqsQ+eGPlT8tsTk0+Ua+wo=; h=From:To:Cc:Subject:Date; b=fsCpYvPHM3RTjuBW21Cw3j+CUsnDpYZUjW4DU/3tlu9abHdQyjcwfTfF4uuOw/617 JFMg60cMvvC8cfMRQZ19O6VZq4dECqhg3YgyL+a9atqjaxANUtA/C9ZeSn2dH80KRQ dFx581hsdsCdd2i00wrb63M7jF6ys6MKUCr9sgXY= Received: from localhost.localdomain ([39.156.73.13]) by newxmesmtplogicsvrszb16-1.qq.com (NewEsmtp) with SMTP id 8099B655; Thu, 09 Jan 2025 21:32:09 +0800 X-QQ-mid: xmsmtpt1736429529ts9isz3u2 Message-ID: X-QQ-XMAILINFO: M/NR0wiIuy70cFDaHXkOliMT8eIjO0WXqk3Xyc1anHkiromAB2KchAEtCzXXpS WIB1AkmvM4UlJBmbgRCR+EqEzXobmgJIX7U/7flXzjtCgsq0+g+FSYOui5ZCtpv5HPz3MTYlPXoE hXAU1kMBXnhaHDJzjawxgcYKKuVjpLX3weJuGCA4qi5oV2xPbEaHU/p8nbVeqsoj4qEfOp2D69VI zF1Vj/usmPuFP93PZM/BFKWrpYhW5RatmkAvJ5tBDjAc22fAuw87/B+qmFyj/Tp3XGAPF9fFLQws f7YZhogViN6VxDBpLPgq9VCCpNb7IokWsvOrGENvBG8cmTn7UKGnMv0VA/2qbsheNNM1mxv0zGHl q1Bdl/huhwq2N5jXt//xM2v8CEv1Ebom5n+A92HD4aklAJ26DGdCCiFK062FoUump2+Bp7VVkYvR xcWXMV1G/RyupSSrviGE0GVe1IieXZybbqcbrc+aMjRLhGVGDojDktxLTBU7uOiWVfwKSDKm2JXn FVbwvKFD50DDM4YpR4f8EMXVjIJjx2pSj/QAkolYkkB8C1cbZJQmhUQBZ7jKFx9g+aHULUzuyTW8 Q1hrefHaQBVdwV77/zWNCX9bNjIX3EfD+5UHX1yYGKGvwPb7+mfOoGJ8gB6AsFhjLYWLUj/csFc5 sdCU1dNl66eIsqJkH3Cu7WogiUs6AAaBTXxCZc9UMRjMpCkghQXWMwG73NoByfnDBDbzX7Efmoap 6SBmqzBUHcO5wkdlvMH3+toq90ZH1ykijg7JI/n6XAA96FckGIml3EqVEU/H/8P5G/f8AMTt5cfg xClcAK+m6/eeTiIAwcT8hhRcQExBWcD+qp4Qt2IzERWKYTuPMCxUeg++1n+eL4VxLr3gEjCUpokS CPr0GCKA9gb/k6w1vDQh1qTfoBJp5ngWKY21qmzC6m8chz+O0g+/eJ4v3lZYI6eRcH9q2eTC5oMa X52zHAGspVUKaa8u8ZhmelMc/c9KBGQIvCStNVRW4= X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: Gang Yan To: Matthieu Baerts , Mat Martineau , Geliang Tang Cc: Gang Yan , mptcp@lists.linux.dev Subject: [PATCH 1/3] mptcp: fix invalid addr occupy 'add_addr_accepted' Date: Thu, 9 Jan 2025 21:32:07 +0800 X-OQ-MSGID: <20250109133207.220361-1-gang_yan@foxmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Gang Yan This patch fixes an issue where an invalid address is announced as a signal, the 'add_addr_accepted' is incorrectly added twice. If reach the limits, even the invalid connection is removed from conn_list by mptcp_worker, the variable is not updated, so the available address can not be added. When 'ADD_ADDR' adds an invalid address in the LAN, it will trigger the 'tcp_done_with_error' at the TCP level due to 'icmp_unreach'. At this point, 'RETRANS_ADDR' will increment 'add_addr_accepted' again. This patch is also helpful for issue#498. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/498 Signed-off-by: Gang Yan --- net/mptcp/pm_netlink.c | 25 +++++++++++++++++++++++++ net/mptcp/protocol.c | 3 +++ net/mptcp/protocol.h | 2 ++ 3 files changed, 30 insertions(+) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 618289aac0ab..63b5c1d6d87a 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -958,6 +958,31 @@ void mptcp_pm_nl_work(struct mptcp_sock *msk) spin_unlock_bh(&msk->pm.lock); } +void mptcp_pm_subflow_closed_external(struct mptcp_sock *msk, + struct mptcp_subflow_context *subflow) +{ + u8 remote_id = READ_ONCE(subflow->remote_id); + s16 local_id = READ_ONCE(subflow->local_id); + struct mptcp_subflow_context *iter; + + if (!subflow->request_join || !remote_id) + return; + + mptcp_for_each_subflow(msk, iter) { + u8 iter_rmtid = READ_ONCE(iter->remote_id); + s16 iter_locid = READ_ONCE(iter->local_id); + + if (remote_id == iter_rmtid && iter->request_join && + local_id != iter_locid) + return; + } + + spin_lock_bh(&msk->pm.lock); + if (--msk->pm.add_addr_accepted < mptcp_pm_get_add_addr_accept_max(msk)) + WRITE_ONCE(msk->pm.accept_addr, true); + spin_unlock_bh(&msk->pm.lock); +} + static bool address_use_port(struct mptcp_pm_addr_entry *entry) { return (entry->flags & diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 21bc3586c33e..93c832d7feed 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2569,6 +2569,9 @@ static void __mptcp_close_subflow(struct sock *sk) continue; mptcp_close_ssk(sk, ssk, subflow); + + if (mptcp_pm_is_kernel(msk)) + mptcp_pm_subflow_closed_external(msk, subflow); } } diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index b4c72a73594f..2923a8cafd91 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1148,6 +1148,8 @@ unsigned int mptcp_pm_get_add_addr_signal_max(const struct mptcp_sock *msk); unsigned int mptcp_pm_get_add_addr_accept_max(const struct mptcp_sock *msk); unsigned int mptcp_pm_get_subflows_max(const struct mptcp_sock *msk); unsigned int mptcp_pm_get_local_addr_max(const struct mptcp_sock *msk); +void mptcp_pm_subflow_closed_external(struct mptcp_sock *msk, + struct mptcp_subflow_context *closed_subflow); /* called under PM lock */ static inline void __mptcp_pm_close_subflow(struct mptcp_sock *msk) From patchwork Thu Jan 9 13:32:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang Yan X-Patchwork-Id: 13932556 X-Patchwork-Delegate: geliang@kernel.org Received: from out162-62-57-137.mail.qq.com (out162-62-57-137.mail.qq.com [162.62.57.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 529BB222596 for ; Thu, 9 Jan 2025 13:38:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.62.57.137 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736429923; cv=none; b=V+t3Zn7nMDD+nl77q5QjaBS5jd18V9VTsp4ajWCernL1p2l5AA7eEgSBXF1afhcs4CBCV669JOZqd67A59P6IPMMIpxqNVdvay2zYtrHyXtw3vkqWKGaZaCy+HQcfRv8tQudFflX5IeW8CHe9wnjDTpMpnLlGeJYNc/37mWQscM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736429923; c=relaxed/simple; bh=M1oCPZnYDfadQ1DpPz19zC+8N/iGu7KKQN+SVBZX+Cs=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=I7Yu0sPStSd9+fWKsMfQi8Sh3stb42cPD4FvtDItfOSseM7dSDmaZLBui8aflZd1YCYoPNr4Jq0rZjtKo2aklzHsFzIevox1KkrgJ72rVIG5winZQ77LPrHPoobN2QxTX1KPRwVTtbLWDE9djJdRcyn2v9AP1lvoYkzq9vHtdWM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b=qfvL/cIo; arc=none smtp.client-ip=162.62.57.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="qfvL/cIo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1736429915; bh=/MerUg8xywAmRPkK8nk2mJUtUqZmRpp7reApPSscNwI=; h=From:To:Cc:Subject:Date; b=qfvL/cIoNHLQr3UbDZbOnvbEMiRcE28OxJM9NunCmYCq+R5rzsI7OvIHox+Xw43l1 h1qY5ZVFhEgY1rajXZmbT/q8oREGBA7WmB99QCzmjd5rtmjpE9JfREXCemuSaz17Zp i1TTeumvEGKrGrYAVYJiuIOrf+3fKU8qLD0HTmyI= Received: from localhost.localdomain ([39.156.73.13]) by newxmesmtplogicsvrsza36-0.qq.com (NewEsmtp) with SMTP id 8169B0D6; Thu, 09 Jan 2025 21:32:22 +0800 X-QQ-mid: xmsmtpt1736429542t6p6ngco6 Message-ID: X-QQ-XMAILINFO: NvH2zBBgt3uTgmXL69ZLkAEkskchdEYgyyOufdZhTw5i9Wm/9JWQYV3K/JJnnL OJ7nUFewrQ/UzQ0KHuym9Nh+jWEGDTfpdFtV0XtTIEt5fh9eEwX636ikXxVeNK1OvgJSONun5R13 Y6pNbwbqc/Hqjh71aVHZLUROJh1KYNXjyZmEePyfPlXnO1jBhaUUjWAfiw2ZT6qq+tKm/tDH9Ueo vWS0UpHw/RVM+BB83j9Xps/1zD/NbvkBR87JS8/43op/pxjetZYIzGjvqxclyfTztT6Ob75vHWRk 3TsQaa1znrdRuA5LHRGTaX274gAqWb7e2oMT4rwZAVmSYYFZcNYGEuKi9Kw3LSjsABSux0+innNz TCwFUQJRoFBWBnvdGubchPSjfdpY6za+JmMiware7cPA/sjEatxjRPEtbXk+xkP35pyf/mvsJ2vd K+Pb4E7Jj98iQhjd6cSyeZ8hP46+fFBI1gv6JyES0TUZC2X7ffh0SCx8h2e6Z7HKAj3i0SEXM/rT q6Ili6t2c6tLX7O2DxI5uAwL5ZpIBqwZPBHyoX7SHiyQjXsUJbIqx/PoSoB37JqGqXX01mWwtdCn gGVRcP3Xjy1gZgFGwPadhgR7z4wbRhSznL/3jFwmjskqcbhrg+dx2fHA9t6mBwnm4Ho2XSCBcomq ytD+6c5v4dhw+yWhOd0u+cW7iv5crJbbhRCgg5xCZBGnPgo262PRpHd+rDvhS4qhaFHKX6yIMRcr mRxjwFMAKJQ4zIlWfVF8d21CZ1LPQrpIow3Ma8Yk0yXMH2+t0UmZlmWGgFqLS3OHdHDpfmxWlY08 G50ZmvZKvhTJytjpNmHYujZnzN5KUiNvLOFKO+GkqmNwj1t+vqmmNz77b1rOlM2laRTDJWRT1uJi vbrb3i44diD4ecfzf6/otk9SdDjK5AHKsJcQRr2T9MO4OV1cUJGAiIpC7OtfuLems0eAeYAtjM9R WBqVjvI75Qr+oN+AUkWXF+xJp30+xm X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: Gang Yan To: Matthieu Baerts , Mat Martineau , Geliang Tang Cc: Gang Yan , mptcp@lists.linux.dev Subject: [PATCH 2/3] selftests: mptcp: relax conditions in SYN_TX validation Date: Thu, 9 Jan 2025 21:32:21 +0800 X-OQ-MSGID: <20250109133221.220550-1-gang_yan@foxmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Gang Yan In ADD_ADDR timeout test cases, the syn_tx MIB counter is not an accurate number. This patch introduces '+n' to 'join_syn_tx' to relax the strict condition. Signed-off-by: Gang Yan --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index c07e2bd3a315..6b0705d10840 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1361,13 +1361,20 @@ chk_join_tx_nr() local create=${join_create_err:-0} local bind=${join_bind_err:-0} local connect=${join_connect_err:-0} + local allow_multi_syn_tx=0 local rc=${KSFT_PASS} local count + if [[ "${join_syn_tx}" = "+"* ]]; then + allow_multi_syn_tx=1 + syn_tx=${join_syn_tx:1} + fi + count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTx") if [ -z "$count" ]; then rc=${KSFT_SKIP} - elif [ "$count" != "$syn_tx" ]; then + elif { [ "$count" != $syn_tx ] && [ $allow_multi_syn_tx -eq 0 ]; } || + { [ "$count" -lt $syn_tx ] && [ $allow_multi_syn_tx -eq 1 ]; }; then rc=${KSFT_FAIL} print_check "syn tx" fail_test "got $count JOIN[s] syn tx expected $syn_tx" From patchwork Thu Jan 9 13:32:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang Yan X-Patchwork-Id: 13932546 X-Patchwork-Delegate: geliang@kernel.org Received: from out203-205-221-210.mail.qq.com (out203-205-221-210.mail.qq.com [203.205.221.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB59C2594AE for ; Thu, 9 Jan 2025 13:32:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.210 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736429563; cv=none; b=DLziToa5lMqZPT+phDLRPLuAq2/HxXPFYIxEn6iiuaGzqK7ZGtBGAq/tTfGfMvS8+OAY3HI5/Yp7Y+/A60ncXufzGoxunh8HsghGMCmmLwn4AjebVd+IRqIbNUTtSccKyRwSQMLecznSQquE5VC8FTrRslw8GYMn3UIYZr9JXrE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736429563; c=relaxed/simple; bh=/z1vJKZ2zeFkzeQm05OuTmvXerZc4WWyz+9S+q3RmT8=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=XNiTUpKAP99r+RxbpVx+7QF6scpQb8O39NcZ29gZc/E1iZn32jrkZNpqK7Gx2A40C9ZRJBg2poNKs/TL3ryHtqPaRpO8/N9bIlA2VEuv6TUmfLEnyVvE+PYyfNZOPPbem9GPSA/FunPEm0yMcDEn1JWalpHcAOlc+F8ozrCWjGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b=J+B8uAQi; arc=none smtp.client-ip=203.205.221.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="J+B8uAQi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1736429555; bh=J4M2tFViBo/FKvMikDdG3L/Jr6X7bkpqn2z9wY+J730=; h=From:To:Cc:Subject:Date; b=J+B8uAQi0C8aUz59vstd5+ljhtTiKE54lO92NNm6DsAEErn22bum8YpXnxMXFUfEs P3WdoaGLeWs87z3+u8lAOs124NKkhd61IC5YG7B0i+981gUVyN7IYJvsfxKgWkoJxC NIifv/tftQbVqWNdNtNNvBrA76Sns408o51sYBXs= Received: from localhost.localdomain ([39.156.73.13]) by newxmesmtplogicsvrszb20-0.qq.com (NewEsmtp) with SMTP id 820B6C63; Thu, 09 Jan 2025 21:32:32 +0800 X-QQ-mid: xmsmtpt1736429552t7ynj0ljs Message-ID: X-QQ-XMAILINFO: NStMSlBeip5yF8ljdblUDlWNkIRlVMr026AqNFxkixjwSEiqHC4FgRLk52cloT 0BfLwfbJoMvy/9WCVu5cLdUh7CDcRbxsdlVHYFJ8rj2qDqGCMmF7vOuuk0WQ95a3lEztWc5vxFMk 6K9vTm5hRW3C+zxP8aRg+eTsqmlN+uJ+aW/H2JACAE+c5hdegdUY+tV7ViexCjblf/qo/fJ1lr6u xrYO5jnkZK8e+xzQSdL4QJ8T56GNnQXRMiYMgFoSiLAb8H8dQsGO4xpB84Si71xpIKCFa31iJSFf fQikrxWamhdLxEUxIlCQwfnoxM9ciJeRBnE77i72latxITr28sxZXdEZBq+BZ2RAAHX/fxFT3GVI Dd7rmaUIwnAGUciISjCP6i5JPCMr1+ftQ8n3BYK0CU9EPse2GqATAO1c4Wl494iLcNEuL3rKXBiU Uf21ur1mSI97noaKVcDPREd1KgkwfwYAM7LZSHWlqMJDj3Ylm11g+QhQntiaTgeMQ/gn0TfV9Oo4 c/ws1T0AQfTBFwSPW2yInYD/Tci3rUv3kzxttLQQs6hzCfT2GgHP7D6whlMq0BAeTur4407E5PYd ZMs9e0vAnNekqrzxJn9cVuOyEMF+FdYrmEHKXvEsMUSxMeFX/y9DXnM33mhKT0DpWuDpt6oKxuV6 zyJafHBRT4T4ORNFh2J9DwA0AQUg5pregO2Vbu0GDtnwSLRyuurUxSM6XUTc7/da/CH7vxQg4z4H DLbSef6yK1jBGss/jhXZCQOFQ3OMY4lL95ehyRZRNsUnbMq2m3fKZMdKzVgmczq+5Zj87eoBARFk HFOoAo4jh3M/pr+Cg2IAZUeEv8IW0Y+B8BsUqmT1awOnDCtrRfaWKSVst0kgyWtZN4Nr5BrUWyoJ t5do0oPciPhAfaPH3XyV535nlyfKoOE4ap9mjQbyZgBV2iJRdlZ/46VDJYom0CbkdEvCdM/zPrXj 5MAsJnceZRBP3xzZbadg== X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: Gang Yan To: Matthieu Baerts , Mat Martineau , Geliang Tang Cc: Gang Yan , mptcp@lists.linux.dev Subject: [PATCH 3/3] selftests: mptcp: add a testcase for invalid addr timeout Date: Thu, 9 Jan 2025 21:32:32 +0800 X-OQ-MSGID: <20250109133232.220644-1-gang_yan@foxmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Gang Yan This patch adds a timeout testcase, which includes a invalid address within the same LAN, along with another valid address. The invalid address in the LAN triggers a TCP error, leading to an incorrect increment of 'add_addr_accepted'. This test ensures the valid address can still join in this situation. Signed-off-by: Gang Yan --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 6b0705d10840..80ce8daac2a8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2318,6 +2318,20 @@ add_addr_timeout_tests() chk_join_nr 1 1 1 chk_add_nr 8 0 fi + + # signal invalid LAN addresses, which will cause an error at TCP level + if reset_with_add_addr_timeout "invalid LAN address, ADD_ADDR timeout"; then + pm_nl_set_limits $ns1 2 2 + pm_nl_add_endpoint $ns1 10.0.1.3 flags signal + pm_nl_add_endpoint $ns1 10.0.3.1 flags signal + pm_nl_set_limits $ns2 2 2 + + speed=10 \ + run_tests $ns1 $ns2 10.0.1.1 + join_syn_tx=+2 \ + chk_join_nr 1 1 1 + chk_add_nr 8 0 + fi } remove_tests()