From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3A356BA53 for ; Thu, 15 Aug 2024 20:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754765; cv=none; b=T2r3NbyiR/tkg2QJmIxvM/SXucU4Yop+rbgiZM3170rjrcoWtWtKQ72ZCr72GzkK/InKb8b0KB/PL7BMYM1TBeQfMfg1rlEvk3kmUt/T4uIvS4XZ1z9VTNyaK9/QORWdRPBVcgKeavksfXVhZ/iDQrzhmniIGeGwS1PaplyI1YY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754765; c=relaxed/simple; bh=LVAGW+m51cX5GlqSgTa+wBpD22XWDMdDSNnxUUITNx4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LGbbkvlo6vEwkWT63TtMC8ZOHVmu02AYQIDmH2moFjbhzsHgNQx65ygW29E1z5432qdOCS0CHFyy4RxpsFyL7bW/1SHT9BRimxtKV7aUyDx+7N2lK21trHX7kd/ax2ozn2R69umc41sCNhW6Yhpmzo+5bkPxaXyOJpqEa38PD0M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UrBFqPmO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UrBFqPmO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79F9AC4AF0B; Thu, 15 Aug 2024 20:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754764; bh=LVAGW+m51cX5GlqSgTa+wBpD22XWDMdDSNnxUUITNx4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UrBFqPmOKwL/mDLrUXyczw24giXaeGfJPthNoLLvhOBFAhRon/V4Y6uQWDvJaCENg KfvLPWwP7VSKZyuQDaOrD+qjAIczrPU64JETQi2hLXCwd/+cGEfM4RX3Mya39iw7IS 4k9Ns50kQq66vQGSPkf6RtgqRB7EzX0Zg8vLD9f8DtdutArbyo/axauU3mwQGlh1zu aOpQodPpKRmSLf8kN7eGaQLYsJU6jbrjID0/f4N/nUgHYD97g+O23H6A3Zwns8zTOe WTodbjwjdawW2C91sHbZex7ubx/zmImwhPS8zslLolaf4oLI44Fa+DF/oaL85vK6h8 u7SJFgeUUuzpA== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:42 +0200 Subject: [PATCH mptcp-net 01/10] Squash to "mptcp: pm: re-using ID of unused removed ADD_ADDR" Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-1-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1177; i=matttbe@kernel.org; h=from:subject:message-id; bh=LVAGW+m51cX5GlqSgTa+wBpD22XWDMdDSNnxUUITNx4=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJkQ6h+5tGjlDhcrlgOmZuFFD8CCOy3oaSd DC8bbPsw8aJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c2RKD/9rPY51m/4IIb4K2BF6qaDjps/7lsymHULoeuxPwA7dNVFbmc/PixzA41oVxNxuT2Ujfic 43NzJnbcmvqtd4SUwzg44v7a7+WkM9L9bHX75HKJsWfRqNHGdAWq9Y0pmds/Hn5C++UMjVbacKa IqWTy+feTGNUWI9qKL/uiwt59p6jbQzS1IZvymS8kzTpcEGnpbJmXIhlF7ifCxgr2fHZJLkuUvM gp8GL68mAdZqKVbpqqeYe03nTQ3cL9pTGB7gi1NXAaUOewnkbE47hgcFxjuYW51lVXYSh+uI7no Ohs1wW2M3MALk7TJaPobSK4sy9rl6bsIbgBdlZA+xfDpfTlQip2djInzriuIjcxrG52LBg3DwmC mcnFbZpBivhVUwDUpB6L8N4E8+cw8C+SC0BwirrPvvQcHz6ihRoe/dnsteabvUSNfEbgB3+fO+Q mjV7/oOP1ZCLaxQGfZfhqXOQq8pjx9I8wW/5Hfh8lxsPKQBmGWspICgKArppnPa1zPYWeoyDrwh KPMTy1agEVFUqkglm5pVmqD9czYb3DTzxa4Uwe8d4xGhovsuY0EX8iGOGuUxVbbk/qJBoy6a4gm h4PbbApK6baLWh31iU/l32DxsbcHnrnOeSh/+eVuWO7h72TuazwRJv3B5R1GA636iYHg/EWyfgQ /v0fLFWcIvFC88w== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 When removing an announced ADD_ADDR, the ID should be marked as available only if it was announced before. Otherwise, local_addr_used will not be decremented when removing the endpoint. That's somehow the behaviour we had from the original patch, before the previous Squash-to patch [1]. Link: https://lore.kernel.org/20240802-mptcp-pm-avail-v6-1-964ba9ce279f@ker= nel.org [1] Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index d3b1b459e6f3..0881983f505d 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1455,8 +1455,10 @@ static bool mptcp_pm_remove_anno_addr(struct mptcp_s= ock *msk, ret =3D remove_anno_list_by_saddr(msk, addr); if (ret || force) { spin_lock_bh(&msk->pm.lock); - __set_bit(addr->id, msk->pm.id_avail_bitmap); - msk->pm.add_addr_signaled -=3D ret; + if (ret) { + __set_bit(addr->id, msk->pm.id_avail_bitmap); + msk->pm.add_addr_signaled--; + } mptcp_pm_remove_addr(msk, &list); spin_unlock_bh(&msk->pm.lock); } --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CEFD6BA53 for ; Thu, 15 Aug 2024 20:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754765; cv=none; b=R7UTmgQKOPc95YOQ4GC2afEInyuP2in7woC5I3Uovnid/hI195WlSM1F9OVhMiR7viH7BJ917CHHF8TKtO+UnFxTqTiop3jwU/hmFEtBeOd2dC+/lgJ8e0+sR+7jdy1cvf+xJTHCYqSX87YOMB0Jpp+23igZff0orLyshmdqQko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754765; c=relaxed/simple; bh=PiTzOMgVE1dFUlDrqVvyhkaMMO3fp8l4gkC9UWV1y1A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GfkNmv+pqwxqNbTE8xf4xJfd9d8ZokR4xJUChsW+nkvOn6gtee22IWws2fzvIjpqE2t0LgALPC26/ARhWvI7tl9J6CEYf1YH2s0LWtDgz9rFjsDQcoW3VtFj2GxIUAd+7hGuTME4yuwxNt2e5oc8LRmIDK5rdwpWOw7N6Wqm/cw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=giNjweZt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="giNjweZt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB764C4DE0B; Thu, 15 Aug 2024 20:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754765; bh=PiTzOMgVE1dFUlDrqVvyhkaMMO3fp8l4gkC9UWV1y1A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=giNjweZtcU/37QVwIFdbaOL3AZjTw7PK0ySjDsfG3YLAP089hbdKAJk4Gdh+n2RGm 0mhuHMLfk95wnfdj1xSCCav/LRnxNTIMD4k/QQepYx3Q9lkLV3j4qGOmZdwld+vDEA e2fHwlySbAKh2AfcgHiXrE53ydtGc2n2k5JaOWdn45XlyRPrljmcPq9ly6Y5XUsiOb pBXUWJRuPwmbSj1PaA8cr2kJlpMR7mLcrYN5ZRXj4IjaVYVr0B8x5YWVQxpau2kIdX 3awmwnsMfW2nU8ptxTnObse4dn2bfsJ/bSCeQTTjklVEhqhpxGicZvP28jwZPt5foK DJ7Y9kr0XL2eg== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:43 +0200 Subject: [PATCH mptcp-net 02/10] Squash to "selftests: mptcp: join: check removing ID 0 endpoint" Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-2-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2822; i=matttbe@kernel.org; h=from:subject:message-id; bh=PiTzOMgVE1dFUlDrqVvyhkaMMO3fp8l4gkC9UWV1y1A=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJvjhIhcq022l/HVmMyl2YWVyWtBUqKduzL sCPlThDphqJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c4MpD/46NwwErrPE8c3YZ3GUzKD1lF9FtRxUilOMn7yfMupFRZF3lHpIC2ZV+VwfYqqP0PFxRc+ PzEwA0Otqm4GKMGySKnn9y41ifUmBTFtOwJRX8+w/DVX1oLswFXQnjbSLbJjrw774UXWntJQlXY hs3mnkFgKW5/E/0ZtNDjDeqpUV9QaE6pqFPPoDmZDS1kYcMuzGH4STdMjuw/fT/nEsYx5gnz/AT CUUyVg9bZ7J4nhKh3JsTjThNibysQU+cSIkz9TWtPq09iFm946pTN3DaWQAyg/v8L708VlKOoD0 KNuDuyZIan+ulNNT3HGLhxhmpgMGZh/o6fzvU0bJoWAP/GJVVVxI/sK97IcpoNONI9Wn0DkPcXI VUVvFGgLW4aMpmo96AqXTH5PNoLaEb96Sfk23/stfREhAsXg8p7WnMOfkNO41AnIIFApU1+3xTx 2l3+qQVzhVgdhdS1Ks8oXIGQ3r6SQMgqZ/7DyDiRRIc1JSak1Ad0nRC4nFbQtUsAqjLAVXSKLJc zUJOmsXMoiAyY9Zhdtek9EmnkSuBo2cGgjf8FH1sk5gTypX/vRUDSJxzt8ryBp4q/hkqKU0M0V7 9+WgPPq1M/YyiPrZcoo/PuiYUKrb2TUQ9Zidz8U1/7rB/VhZSL6gaKqw1Tcab7ZxbyxDeySQSe5 VK8OVKrCu/Y+JmQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 The original commit was replacing the recreation of an endpoint used by an additional subflow, by the one used by the initial subflow. Except that it reduced the code coverage, as shown by the previous patch fixing a bug no longer visible with the modification of "selftests: mptcp: join: check removing ID 0 endpoint". Instead of replacing the endpoint 2 by 1, here an additional del/add is done on the endpoint used by the initial subflow. So the two cases are now covered. Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 32 ++++++++++++++++-----= ---- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 77b3a68bd8f7..0494610694df 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3659,36 +3659,46 @@ endpoint_tests() wait_mpj $ns2 pm_nl_check_endpoint "creation" \ $ns2 10.0.2.2 id 2 flags subflow dev ns2eth2 - chk_subflow_nr "before delete" 2 + chk_subflow_nr "before delete id 2" 2 chk_mptcp_info subflows 1 subflows 1 =20 - pm_nl_del_endpoint $ns2 1 10.0.1.2 + pm_nl_del_endpoint $ns2 2 10.0.2.2 sleep 0.5 - chk_subflow_nr "after delete" 1 - chk_mptcp_info subflows 1 subflows 1 + chk_subflow_nr "after delete id 2" 1 + chk_mptcp_info subflows 0 subflows 0 =20 - pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow + pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow wait_mpj $ns2 - chk_subflow_nr "after re-add" 2 - chk_mptcp_info subflows 2 subflows 2 + chk_subflow_nr "after re-add id 2" 2 + chk_mptcp_info subflows 1 subflows 1 =20 pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow wait_attempt_fail $ns2 chk_subflow_nr "after new reject" 2 - chk_mptcp_info subflows 2 subflows 2 + chk_mptcp_info subflows 1 subflows 1 =20 ip netns exec "${ns2}" ${iptables} -D OUTPUT -s "10.0.3.2" -p tcp -j REJ= ECT pm_nl_del_endpoint $ns2 3 10.0.3.2 pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow wait_mpj $ns2 chk_subflow_nr "after no reject" 3 + chk_mptcp_info subflows 2 subflows 2 + + pm_nl_del_endpoint $ns2 1 10.0.1.2 + sleep 0.5 + chk_subflow_nr "after delete id 0" 2 + chk_mptcp_info subflows 2 subflows 2 # only decr for additional sf + + pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow + wait_mpj $ns2 + chk_subflow_nr "after re-add id 0" 3 chk_mptcp_info subflows 3 subflows 3 =20 mptcp_lib_kill_wait $tests_pid =20 - join_syn_tx=3D4 \ - chk_join_nr 3 3 3 - chk_rm_nr 1 1 + join_syn_tx=3D5 \ + chk_join_nr 4 4 4 + chk_rm_nr 2 2 fi =20 # remove and re-add --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B3325BA53 for ; Thu, 15 Aug 2024 20:46:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754766; cv=none; b=kfmbjNRpL1sUigCFLszVdPLNastooyHfSTX4GsB5OJmljh4wyAkyNBqyTt5XsK6WPasUjL7pL8HDBJSOe3KiUf//+ifnLyIVLBpcs1sTRjmmu1w8U2NQaOdqi+RYcF8yMUrALG4Oxh0GTNrTNpVrcWAiO1O3Yj3sb8p3HZrZvQo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754766; c=relaxed/simple; bh=7fYVhVSiDGBxhZaQ+j8WgFHVziAOkGMTgOJaJhC1Z2o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VwcRbnV5x3Vw+wimA54PLrAvo9IXVZJ74Yhag5LkKvwSyUCF7K7yCJlswmRP8HykueswL7WbqtI9KDHlAF3iTr8E0r+zfgl1nAiPrzJNEODHz/GLKelaFAwK4M284ODm8eSbbBAFetM/ZG+cyhnlfZdu+1JYuMNWmOayqP9fg/8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DNO3k7Ua; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DNO3k7Ua" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8967C32786; Thu, 15 Aug 2024 20:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754766; bh=7fYVhVSiDGBxhZaQ+j8WgFHVziAOkGMTgOJaJhC1Z2o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DNO3k7UaLJ78GCxKIxD5w7maVD6EcDBlk5DCs4Cp46r4EXMIReT8gDN/GUzrN7khj p9RH9Ob9wI5XtTzdpDRNVS/Y0Etf1Uz/VBoCTeZ8h4qtNN+k1+v4lOw1S7D9N1iQ/C X82ocxuRSFoByP23ef2tbmuQDpO9MpozI5xAHpE8Cc3UpIKsGGs+4yXjfaM7bXvz67 GNTQznQdYv7ji5yGkX+SXn2FZfSuKwAnUH0yDn4UsWGtM++NWK7JISgxbgMjJHZo+V QE1VkmJYfejq/5IJvMfgNEYYsjwLHuSjrjlvCh9Uo974Yof7AHFbvgh8WhCVvWDv3i OpdoDXF/umTbw== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:44 +0200 Subject: [PATCH mptcp-net 03/10] Squash to "mptcp: pm: reuse ID 0 after delete and re-add" Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-3-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1266; i=matttbe@kernel.org; h=from:subject:message-id; bh=7fYVhVSiDGBxhZaQ+j8WgFHVziAOkGMTgOJaJhC1Z2o=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJAlNYVTs6lki+KKPM0FdeqMJuH0L3we8i7 fqadLPNhiqJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c9BGD/9n4jKzvP5Tojl4ILHICtK1qHolGc21TZCeeYvQF/wxaYTo7gSVqGGzyCeJSn7B8QWy1ev tzDabidUzcDlZA7IeNpq4suwHlPoddtkRMhVT/1Jks5nZTPOQfdrzsYwha2DZ12fAGt9aZgfz9V OQIR45/slCB9rIUcI0COMddn3viPb/ENaSXwHz/cR837NmjCvXBssdYBuzeLF/S9a75/teDRNmZ ItcF518Xsy4eiZExZudJb2gvHGtSeZ/l2FzIOWLG/fKXfu3wmgrCKS+Omzbbed8qBJPPkrEhj7A 7EDFtKRRC3KRnF2v0oyG+Kq0f/Hrq0NJMVjNsqt5773DJf+8tiDTYwCvnwblcaqXcSIhi12ML/r uGimMpXYPWu4YuA2OfVKPi0jbnRCFPogVI2qYsZh2B/BIsrMNPci+T07sJNopFMjN1xXix/rvpq q9yEojcB0lkzE91ZHq08bn9BSYdhP7g3wMeHkFwH6Nuu1Oof1/OLGYNbFo/hFbutqFfx5rF3YMr rSYCuGqWy79yK1tDPLc6QU56NDCxluP2IrkvuSB6CHiPhEHF2vk4yHaVtma6VBYWndWD+AhhVH0 RSDilVT6KhrSFJ1+Z/5L7yCCFSurP6a7YkO2Xw6ZRlLJaDKLmIDX8HtRNN50Tv0zu8ozQJEoD3h LR0+FUEtpruR2VA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Set the address ID to 0 before calling fill_remote_addresses_vec(): for fullmesh cases, a bitmap will be created after having looked at all subflow IDs matching the local one. The ID visible on the wire (e.g. 0) should be compared to, not the one of the global endpoint (cannot be 0). Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 0881983f505d..b2d950e4d7a3 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -621,14 +621,15 @@ static void mptcp_pm_create_subflow_or_signal_addr(st= ruct mptcp_sock *msk) =20 msk->pm.local_addr_used++; __clear_bit(local.addr.id, msk->pm.id_avail_bitmap); - nr =3D fill_remote_addresses_vec(msk, &local.addr, fullmesh, addrs); - if (nr =3D=3D 0) - continue; =20 /* Special case for ID0: set the correct ID */ if (local.addr.id =3D=3D msk->mpc_endpoint_id) local.addr.id =3D 0; =20 + nr =3D fill_remote_addresses_vec(msk, &local.addr, fullmesh, addrs); + if (nr =3D=3D 0) + continue; + spin_unlock_bh(&msk->pm.lock); for (i =3D 0; i < nr; i++) __mptcp_subflow_connect(sk, &local, &addrs[i]); --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3947A14B970 for ; Thu, 15 Aug 2024 20:46:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754768; cv=none; b=Xt+OUGTK/MmTj6eew5dVkgBgaIIcY4f4a3id5D0cx/Mj8bAxOmIZzYVRvGL78a3NWoIaAH/6LNNFAEwEq1SwHlRw2L+PkGn3wrygvl4YmVpppgvNcegBYzok606+faEEDMUAuZPntgK/V4zFXoGtfZXhaI6TNxp+/AjZxUBfUfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754768; c=relaxed/simple; bh=kDArB3xUDpdDvMhQFCV+agltE+x1zALvRqZVBQrb00c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b22an8wKlFARefoBoL6YMlNC2VHEfb+AKBaUpBAM3CK/h0FXiuS6htj2nXIenfEK9QeqpZ6ers3tqVXuGZmJ4sj7CndNGYaa/7Fwd5Mzkd4LdO9Mt6qLKwNVJSFmlJMp795WWcaf7DVYaQfVLsdm5Sb7d2esRm76kWRmYLwwHzs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IIKne4ad; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IIKne4ad" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FC1AC4AF09; Thu, 15 Aug 2024 20:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754767; bh=kDArB3xUDpdDvMhQFCV+agltE+x1zALvRqZVBQrb00c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IIKne4ad5r2Wg8LHZYXsAPbH/3NR5prVma9+7TQ6dT7rXFF7gYdkNPmb76h4PMjd/ 79/v10J3BgF+J1DMQPW2iz5VSAPtMrysLjFhjEb2ipOKHikEz2cNbxfZyDNDeNIWzS fDqtYG7eGpPvGAKkm6v1zoyLDQDvSFICc7MrFqOg+daYqOir7Set7jU/t6SdOsevP6 17+G9udw7QdNepJepNtT5pEkAgRGEsj97NbV4ppUH74fkXvfJcd2qNQ/0jUbF9Uo2u /hkmzMBjPSl8/GnIgOgEkmMCsYcwBWlGADFIenLTFIem5D2UdoFhYJ3vCYXmnvio1M rcMFaifBJnggw== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:45 +0200 Subject: [PATCH mptcp-net 04/10] mptcp: pm: do not remove already closed subflows Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-4-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=967; i=matttbe@kernel.org; h=from:subject:message-id; bh=kDArB3xUDpdDvMhQFCV+agltE+x1zALvRqZVBQrb00c=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJDmp6hdEEp3JlMa73FcNlEvGLiEQyBk3ox kClcTAGJr2JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c87kEAC0xMdkKMs/+CRzMJTqjCxEsX+NPMgc21uZFEP1Dv5IO4ujI9gXV4rG0WLftaMCTKm/3i4 VIoV+IZj9nqK6YCklUYwffd8jS+9nm29FzmA47YoLwgduNCg7GyGSYvgjJROsmL5WmiHA7MD6kK 7mvmi6TpyW3RZl1L587J9b2JQhTiI2lqwjeaYXMZZ1NBhNOLWPaxStD4vcGjrKaML3HFQFCVWIY xkRFqz7fD3+an9eGbEEnlOr56qM0v2BamIR8MPKWIZcf7VJZ5WbLakCvMwG1zhnqCcrDFlGasDP nSLiA6Nz+J7PiYWC+mMbn74QI/UzzgvjepeWEqis3AkaQZzMNXt1QuelMX1qLlkf78qLYcJRXgD znBFMbWbZJLVsuILlw8vpoqTata+v2aEJky5lsUC1LFMCYhnv/v5qneOXC+yCp77W0h45Z5Htgm jR5TdEpneD9s/z9qh7Msj1DpIUM27yzhC78ix9Oza1mU0YMzU3FDX7+he5rzkF5z87EcvYY0ZqS iZ6gfOA00grtWJUHUamwR/JuOSMP1M2d95NWOHFb7Fw21Bs9KBsMIDnL7IJMBsyEdMHleRfNBGU kE47YRZXaGi3PdFdltrnPcYc7i+/gfFlQ+46ptMFFCdV410LUcJGTEKXlg6Cb+YfShlW2N6BBQb 2perkiAlQw7H/qg== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 It is possible to have in the list already closed subflows, e.g. the initial subflow has been already closed, but still in the list. No need to try to close it again, and increments the related counters again. Fixes: 0ee4261a3681 ("mptcp: implement mptcp_pm_remove_subflow") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index b2d950e4d7a3..7ca9dbbd5f14 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -842,6 +842,8 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp= _sock *msk, int how =3D RCV_SHUTDOWN | SEND_SHUTDOWN; u8 id =3D subflow_get_local_id(subflow); =20 + if (inet_sk_state_load(ssk) =3D=3D TCP_CLOSE) + continue; if (rm_type =3D=3D MPTCP_MIB_RMADDR && remote_id !=3D rm_id) continue; if (rm_type =3D=3D MPTCP_MIB_RMSUBFLOW && id !=3D rm_id) --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5FC6A149C6F for ; Thu, 15 Aug 2024 20:46:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754769; cv=none; b=cADUOaoYcc0eDQ16xzhnI4nXHcanqUpCnKPcYelgZ9/vBH8wnV2mlX9lzlYXAUiox32UWyVySeeX4UxWNpLOnYVOdV1cuCP1NbIZg5TFni+WEBJJm633uVIswVSM9VYYdWk9ePX6bHpgOHFVFJobpoT9AjgBFmTuf/fD5olzPvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754769; c=relaxed/simple; bh=CY/dBHTp2w67SptUG1aeyE724qNvFJ0H98mr29KmlwQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RVNZf+jXIYax3j/bjcvtxPDJO9w+AvyWp4MFYNt2kW4Z58wGJoONVt8zqrvRsZFki4i77p/aWoaXk9SvH48RCsSYVmHTzWYFsj1O9UqnioiXLAEHFXbSPv5bas046+LtzGxTdx1tzFNSetvToWsdBO0EnhBVBdq3A7JVM+UExNw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ErvklZJ0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ErvklZJ0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39391C4AF0B; Thu, 15 Aug 2024 20:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754768; bh=CY/dBHTp2w67SptUG1aeyE724qNvFJ0H98mr29KmlwQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ErvklZJ0RhfY85S9oSmUkbIf5k7GNj4BY58rcYyxm+9qBYGH2sLktsCVaxlhoJK4S 3aS/ZZUntoOyCHtEfz9V0d0wpMdDUmomkw/rZ4XZiFFtPsxn5q8bvWt/1HaHzV3MSZ kufOVAH+VbyK1YI5CSIBEtpYwOaPe9QP1o1M0cFMf0aT59M9Ln94/myE/wAYgM1wOb GX+EuPI4rBUGOLjpzptU8uE/CWcZYq6stDd5IN2OlL28UGcy/N7owynl8cu73emn+H BDF45zxwCMmeTXH+P7ocyOOv4HIa8tJMr7pJlb4Qve6SAHerIrqGskw4VYUWoF+UPb fWkeTkKZet0cA== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:46 +0200 Subject: [PATCH mptcp-net 05/10] mptcp: pm: fix ID 0 endp usage after multiple re-creations Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-5-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2038; i=matttbe@kernel.org; h=from:subject:message-id; bh=CY/dBHTp2w67SptUG1aeyE724qNvFJ0H98mr29KmlwQ=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJHAAv9Oiv7ndOxc2YD4erbLW3/OFNm/kXO Ng8MFqzs4GJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c9gvD/9bKWTYRimQ7YocAuySKT2WZrfeHOEy4xaINOcQzdnqDCvRaNET6Hh06cGicKchJlW3JPH b1YSpTBAXSIFIRlsH5rpmhwLbEN4W8ygA/xzUPe4IoICyUQJHPGZO0T3UpdBxuKeBjZta6GFyFT mAYjSWQeBaiWMFexoko8+ImzKzPTZdRz3CI2q4G7pXeJuE0kU+UnyUTgi6r8ZPAL978nz3YlpFS Yyc/dkkiPcCy1XL5FItgf5sqaqm7sTBYl6pPwz5FUzxHWMUVDPA37VYtsOUVs7RL8KHbghUvrq1 MFVmdMuBraoV2kDIfbUy83s0Bha+8rQHDlISEGBJlwhr7YZqCLjVeeh5fwnUPR2mpLN9B9nBWTc k3oRr/9eFUj1Whk5L59K4K8voIluh7/IR6sTJLzLT5gQ+mP1sk8cBf+9GGkCK8cghKYU8YfPzy3 8c3Jybxcp/T7he5ncc0VdfU81OuaTW3GjWTX9lOBHwA96eCGhtqyXPxnE55jVtI8FLqDI4E5rk9 vjQ3XQ9t9bWVrnQUcjoQNnS+j6BNPUUlhnibdU0f4QBx/gh1XBEFafvLY64srYG4VosMsMYi+53 VYFZ2n+yKq1RgqAAwnFIMC/Ksr7Oa0TmPGU9mmHakj5vpDPCTD14kO4njT882CLikf1pQuHdzbW hu7A64VNk3E4vag== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 'local_addr_used' and 'add_addr_accepted' are decremented for addresses not related to the initial subflow (ID0), because the source and destination addresses of the initial subflows are known from the beginning: they don't count as "additional local address being used" or "ADD_ADDR being accepted". It is then required not to increment them when the entrypoint used by the initial subflow is removed and re-added during a connection. Without this modification, this entrypoint cannot be removed and re-added more than once. Reported-by: Ar=C4=B1n=C3=A7 =C3=9CNAL Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/512 Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 7ca9dbbd5f14..e44f539e6a56 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -619,12 +619,13 @@ static void mptcp_pm_create_subflow_or_signal_addr(st= ruct mptcp_sock *msk) =20 fullmesh =3D !!(local.flags & MPTCP_PM_ADDR_FLAG_FULLMESH); =20 - msk->pm.local_addr_used++; __clear_bit(local.addr.id, msk->pm.id_avail_bitmap); =20 /* Special case for ID0: set the correct ID */ if (local.addr.id =3D=3D msk->mpc_endpoint_id) local.addr.id =3D 0; + else /* local_addr_used is not decr for ID 0 */ + msk->pm.local_addr_used++; =20 nr =3D fill_remote_addresses_vec(msk, &local.addr, fullmesh, addrs); if (nr =3D=3D 0) @@ -754,7 +755,9 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_= sock *msk) spin_lock_bh(&msk->pm.lock); =20 if (sf_created) { - msk->pm.add_addr_accepted++; + /* add_addr_accepted is not decr for ID 0 */ + if (remote.id) + msk->pm.add_addr_accepted++; if (msk->pm.add_addr_accepted >=3D add_addr_accept_max || msk->pm.subflows >=3D subflows_max) WRITE_ONCE(msk->pm.accept_addr, false); --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 45026BA53 for ; Thu, 15 Aug 2024 20:46:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754770; cv=none; b=D76ckhWtMCIqOW6/lf+DQQ6/YcXjn2bLphRga30nFrpu+047ePxFyEd5gji3ghFMOhlftoQ360mBI4SY1ubIn6YHXZhCodeckounNBbrhF0oZRuXa8z4QKRVOSRv4qfRt6JEzqRAax5SyutopZCpKRdO0aWwTEa0iq9mwNqEdus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754770; c=relaxed/simple; bh=MhZtPAQpQiUhMe5YQjVGhj0SH+lZFTkpf5yWENfo1mM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ka0oQCMNn+ytQkS/vjkThQ8Km/CifSv3yzQRg6pK+mE34tkDbCDK0s50Ie2cpFDegl3tJBOvoFRgp9SRDsR+IzXHL/65TtdC2whKsXjJGc4W+WiJSnnOrYhW1CgMDyV4kf7iBRSxk6qAsTjCp+a2zMcpizhRCLPr1tjEWkeKzzI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=brQgBtIb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="brQgBtIb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63654C32786; Thu, 15 Aug 2024 20:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754770; bh=MhZtPAQpQiUhMe5YQjVGhj0SH+lZFTkpf5yWENfo1mM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=brQgBtIbTq7ynhPZjFQjX3hfVo5KkzDVpD62nuwbUyd8Ngd8oJNjVGlKgUePnRNg+ ryoP0mSkxRVo0yHbQ2dNahidoahYpmSMSrwrs0NCdqyfycqMofsF6O9r/Z58MKdA8x jmQLYdLz1rPM1L3VPE8i9bpipbJ0sMzYcSnhEjDluPkFoNTwq3++Lf0IFn5mVGrx3+ 9bhXBmir/5ajXSlM796oiyEg3f/mK7lNAQTIKzEa7gopJnNDuhuahNquZwzaIpnmCP UZzni3m/fsPVu4Gu1b8N8CbeTyxpsZ0wgU3yVVEaqWL4DI/5tf6IEgAoOgy86bp3o3 fnfEibMWVrG5g== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:47 +0200 Subject: [PATCH mptcp-net 06/10] selftests: mptcp: join: check re-re-adding ID 0 endp Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-6-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1810; i=matttbe@kernel.org; h=from:subject:message-id; bh=MhZtPAQpQiUhMe5YQjVGhj0SH+lZFTkpf5yWENfo1mM=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJJFSKjJzaYJExL8Vn2vXRHYyS9QH96b6cB cSUACdo1oSJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg cx94D/9Cw9XXHGm6/2bmk82GhT0Q3i8FOQ7FMnX58K0xtRjQon0rzRmcRtn5DtMsyVvhylAcHhf OWcHF8DJNAz63kvrQ7qobIniR5OafSvzkYk18C2byiK10nHz2Y+yW+B/1rRjDzFJUC1ThxIpk1Q U/s5OgvjvYiRamvYRGQCZMHau0BshBLqi7AeZb83GQ1YK+wA5DpzIu5ITKONQUJBdxNVURNNfcj +dkFS8RoKtyopxk8fM8snlBpapSiBvzmUKL/YRY/K0S6y++QCaDOUEnMeJhE5LCgH/qwfc2FNUT AonrHAeX6/MHFtPXUfeUlm0YNNNwOPU2EWSK935dETwvwqMufNVRVYUeM+ngpfXFNSRSIqYSvm+ 6qnxQjWOfxJ5pGwBTRFiZ+rcRmBH1bhLrI3LH5z1vpZGNacLX0wi87BJFsMx8NnOB7/fSjE3YJs cbfnkZCGUhrT0EXgNKpstYtoQo40W1Z8Jb0BQXlx/I8YqJ3JUIGEke5THsAA/zaRFyhVAY6kntZ Xx73SBhLjGof+ZWazYxhEbEWDQDzNuLnhNy0/t+UKhYlaqnrsVBxIn599H+c4qrAD9IGuypOIK1 00OIhlb2Ml2pRJtEjuN8jFl5wGJvC2r9452/1nP80N5HcEe2uNGVpv3y6AZIj44VowYApqI54aV 2yjk61IMc7PVypQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This test extends "delete and re-add" to validate the previous commit: when the endpoint linked to the initial subflow (ID 0) is re-added multiple times, it was no longer being used, because the internal linked counters are not decremented for this special endpoint: it is not an additional endpoint. Here, the "del/add id 0" steps are duplicated to unsure this case is validated. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 0494610694df..af722227b9cd 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3694,11 +3694,21 @@ endpoint_tests() chk_subflow_nr "after re-add id 0" 3 chk_mptcp_info subflows 3 subflows 3 =20 + pm_nl_del_endpoint $ns2 1 10.0.1.2 + sleep 0.5 + chk_subflow_nr "after re-delete id 0" 2 + chk_mptcp_info subflows 2 subflows 2 # it was an additional sf + + pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow + wait_mpj $ns2 + chk_subflow_nr "after re-re-add id 0" 3 + chk_mptcp_info subflows 3 subflows 3 + mptcp_lib_kill_wait $tests_pid =20 - join_syn_tx=3D5 \ - chk_join_nr 4 4 4 - chk_rm_nr 2 2 + join_syn_tx=3D6 \ + chk_join_nr 5 5 5 + chk_rm_nr 3 3 fi =20 # remove and re-add --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C5AFCBA53 for ; Thu, 15 Aug 2024 20:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754771; cv=none; b=uvGHtLrnxuYr1NY2PT8pBUh3KSm7PiOYQwuciv8vcetiUxRkgck3Waz2bNmxszUZaA781EBaNoigRI24PzmmTkKXs+wEa1q1zqlLRJaa7mwHY6q8poxhjuZ7ZFJknBnXnnTlVzsNEMpfzEgLIuoPLiMITVqorSeXgM9ZWsGmyIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754771; c=relaxed/simple; bh=X3kingAe+MIqD04vcc6XOI2en1Bn6QN9uOtcfEzO/lM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Hg9dkRqW1fNmrLnwXrpAbhwoszm26hap3KVh8JczKYDqGEheu8ZZS1nx9phcSuf5YeO32f+VRt2O350Ji4uDgGu2E+VmO0l0+nzRjFTvRH5VwDXcFdoLUp3+Nf+1MlANvRSUKhCQTPHKI/5Lwni/TTRCOp4q2FxK09CWaYzTL50= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WxNb/VCX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WxNb/VCX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ECC9C4AF09; Thu, 15 Aug 2024 20:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754771; bh=X3kingAe+MIqD04vcc6XOI2en1Bn6QN9uOtcfEzO/lM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WxNb/VCXciz/+2+Qee9h3G78cHqfwKTk3dufiPnSZMX0qCvgP2RjyhqKXB4P+XrS+ be4TtLyRYnfEFkg09lH9gqmKJ4A8edpluhAbxoz/t6jE8noaf38cof2l+vf8D1y/Rh RRpuA5SISJaeqB/j8dwDbUfWUwqEALx0F3raj8aq5fU8qgv8/I1gQCJ4Ml1nGb6fqw sLALPqzBDhLPsFR8+fs+JQzAHzrkHeZ1hbGjm4/bqOZHwsjMLotHFYQnEVoyyVuI6/ a7yL30New+vtqN/E9sHPEJ0bmbSk4+AX7rJtqCybbuWUWdFcSmyBasr3Zdwxmt4VeK l/xOX4BzYZV+w== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:48 +0200 Subject: [PATCH mptcp-net 07/10] mptcp: avoid duplicated SUB_CLOSED events Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-7-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2613; i=matttbe@kernel.org; h=from:subject:message-id; bh=X3kingAe+MIqD04vcc6XOI2en1Bn6QN9uOtcfEzO/lM=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJmULm9uT0qQxcN+dhS8PlewAX7+xb/3Vqa dEFG+NKIiiJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c27CEAC0FlU7sOe+ncOu4+AINoUE939WQjSBw85NDwQYBXszpR4oAM6tsYzarc9jvVJXWUuiQmo clYld9YzJcYjsHWmh2ZJ3U+7UcyfQcmyIQx4pJCl6jbBuxDxjqhBkWaJrRQbs7XuoeewTYBjN3u ICByBlx9Baanss4e6ryyAYkGyHhN0gtdRhQrtAsnwgs6QCLCO5lM0WogbU43ghjCMOY8r4n67v1 IwblT6NhC74H/NwNocFYNNtQU6dbYiDP7y3V6Vj2qz335251lYB/8w/Zttwh532QAhwBuwP7SR3 gKuAOVRbL6aOOcvZt4MhjVvXlrXDW8aqlvogfwQX37tsEKmITT8QwmsGtXJmzDufvATKr09OUon 3pReqejIfyGfgw17I8T91j7Z0y3uz1f+v1L+K+MDzoeJcMAmFvLMHPWHAaSNfcX7pvpb1CW6el/ nxhNVZ8CgtLhWPmRibsnPTx5RBTUG6hYThCYWCB2vb5jSHJZjbzj80WomZuYMNE0qnAOnN0tS0c mPzj6DvfSjvvee2bVd7zfSEzFCZtp9FFsPi94cmFBOxkEcUTlPsydM4HjmYouQxBE0u9ZJfkem0 BkEhF4Q73HuO543/0up054Zm7JNpdsydtkSG1b+ijC6eTIlOY3VBHiTgAid36zAfcaKF2v96Opz ofJb9TItsXFkZLA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 The initial subflow might have already been closed, but still in the connection list. When the worker is instructed to close the subflows that have been marked as closed, it might then try to close the initial subflow again. A consequence of that is that the SUB_CLOSED event can be seen twice: # ip mptcp endpoint 1.1.1.1 id 1 subflow dev eth0 2.2.2.2 id 2 subflow dev eth1 # ip mptcp monitor & [ CREATED] remid=3D0 locid=3D0 saddr4=3D1.1.1.1 daddr4=3D9.9.9.9 [ ESTABLISHED] remid=3D0 locid=3D0 saddr4=3D1.1.1.1 daddr4=3D9.9.9.9 [ SF_ESTABLISHED] remid=3D0 locid=3D2 saddr4=3D2.2.2.2 daddr4=3D9.9.9.9 # ip mptcp endpoint delete id 1 [ SF_CLOSED] remid=3D0 locid=3D0 saddr4=3D1.1.1.1 daddr4=3D9.9.9.9 [ SF_CLOSED] remid=3D0 locid=3D0 saddr4=3D1.1.1.1 daddr4=3D9.9.9.9 The first one is coming from mptcp_pm_nl_rm_subflow_received(), and the second one from __mptcp_close_subflow(). To avoid doing the post-closed processing twice, the subflow is now marked as closed the first time. Note that it is not enough to check if we are dealing with the first subflow and check its sk_state: the subflow might have been reset or closed before calling mptcp_close_ssk(). Fixes: b911c97c7dc7 ("mptcp: add netlink event support") Signed-off-by: Matthieu Baerts (NGI0) Tested-by: Ar=C4=B1n=C3=A7 =C3=9CNAL --- net/mptcp/protocol.c | 6 ++++++ net/mptcp/protocol.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 13777c35496c..9d6ef94ca6ee 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2508,6 +2508,12 @@ static void __mptcp_close_ssk(struct sock *sk, struc= t sock *ssk, void mptcp_close_ssk(struct sock *sk, struct sock *ssk, struct mptcp_subflow_context *subflow) { + /* The first subflow can already be closed and still in the list */ + if (subflow->closed) + return; + + subflow->closed =3D true; + if (sk->sk_state =3D=3D TCP_ESTABLISHED) mptcp_event(MPTCP_EVENT_SUB_CLOSED, mptcp_sk(sk), ssk, GFP_KERNEL); =20 diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 22b7eff311f5..ce15e7db464b 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -530,7 +530,8 @@ struct mptcp_subflow_context { stale : 1, /* unable to snd/rcv data, do not use for xmit */ valid_csum_seen : 1, /* at least one csum validated */ is_mptfo : 1, /* subflow is doing TFO */ - __unused : 10; + closed : 1, /* has done the post-closed part */ + __unused : 9; bool data_avail; bool scheduled; u32 remote_nonce; --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9461514D457 for ; Thu, 15 Aug 2024 20:46:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754772; cv=none; b=BdtXStWgvDf3w+nF7eDLEDoyhdH5esH2d2VugoLd4IQV2ZlIKHBycJsqv3al1PXQwBs6UGqiFKYlwkZjeEWHMErXE8ZQuj+Du1DoYLupD5s2gE+v9e1UjTsCxfjmaXXKI+LIId0TmtohUopfCEvAbbWXrrGh06DmVe6meIdO4zg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754772; c=relaxed/simple; bh=+K0nEDS5SwqXT+ETWiABF70t+aDxdxw0WkoSLjPHsn4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IBvCS0qJ7SrKh15EuSb8y6Nz3M0xRJSQW3SMzy9X5kMh4/Gu6/c2+fSG7KD/AmyTwAgq14jNjRdZ9MKJG6Gz5Gpd6+DpbUyzW77PjR7sZep3X/tQ9DDqBEZQaPgsy2zzuAe81XFg59ND30yCFq/NESHVJDiwuVpkND/5CJMzCx8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qmVfVR2u; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qmVfVR2u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9B66C4AF0B; Thu, 15 Aug 2024 20:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754772; bh=+K0nEDS5SwqXT+ETWiABF70t+aDxdxw0WkoSLjPHsn4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qmVfVR2u+MTFlZbxxlWlkg4wrZcvh4p9Loi3Q1xjpkMXXv/77eAvFyfZTrUoIg9Lc Va2YoJWG54Bu++i53exnmlYAewTr5xVMpgM8MFil27L5FmLPlMeR1Z8q4TWSb+EI/5 84kXwmJChnXtjGoXfsD5hMYE7dEr/UGRZpVI8Pnlir9UKpyitWhwfIj3EXqi4FIs1W b6ERVM8Psy8LWkVipZFgvkS1PTKX1xMhz9A7IwXwL9vnZlFmIrZD6LZ2TFyMmdKfiW IxihEUR9567BM7RDdoDA6f9t9SjKXkkoztLb5LmAm0HG05SoBkDuo3CA6Fw93OzreI zKeN2NHCWFhEw== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:49 +0200 Subject: [PATCH mptcp-net 08/10] selftests: mptcp: join: validate event numbers Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-8-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=5773; i=matttbe@kernel.org; h=from:subject:message-id; bh=+K0nEDS5SwqXT+ETWiABF70t+aDxdxw0WkoSLjPHsn4=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJrdkd8Wx0FVg4c58VwaXFxm8996vrhqlkR L6HjRaV5VuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c7rrEACuXdzzJ0TzVLQEyaapwnnUg6ApZUN3XIGgDuBx2GvqzPuQNQ5FXExm+oiZSVma745qut2 RX75SPFFWD/Wj2sQho0TmyqcSsN+i4gmUXtSBJOrt8NGY+y+E2hSkL4dyG2gF70NxaglNscE/3P X61JeqsSSBD8H68CtXbajQboAD3Ws+pGc2T173waEAWGBpABrp4+17LJGYx26W5OYVILqhdB9LG eXhe12tuvdmuhpAgP8wdCrMWcyDJc3L3IxWN0VyumV2t6oOHF/jwWIea3M7iP8MSGy4Z+Ha4xIc pGJzpCSe0k0aMcBwr1l7J8VDD8dM7run7tPgUfch0pQaJDUu6fU48e+a6Bd9iJ5KZtNXI1kaUu2 j9R8mvas+/9ddQTy7V3aDbMEpFZhO322Vb9OeAPRO3QusoZ0XJ3q76Tfwyc1eeNMngQiTo2Ucn9 uxadLtafrIhf2ZuEypJUGr+PjfjK00Fg2eSoqI4HCktxJyhIcBPTfhByqeuj/bWxmxYvZDXQc8k uwJLz8RaVxNXxHiX/HMeaPhGcwbSuLiv+l/QQTaw83zIlkgiFob+RU63FCypti7Xm3yk+NdVEmX hC4j0n2bRfPUNaJ481uSR1hElXFSv4XF3RRWLXVWGaRniZJGC1kHLTqoi0AIvZwt82IYNrjiGCj L63jFLzDoWEsJ6g== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This test extends "delete and re-add" to validate the previous commit: the number of MPTCP events are checked to make sure there are no duplicated or unexpected ones. A new helper has been introduced to easily check these events. The missing events have been added to the lib. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: b911c97c7dc7 ("mptcp: add netlink event support") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 74 +++++++++++++++++++++= +++- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 4 ++ 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index af722227b9cd..9e064c518fb8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -446,12 +446,17 @@ reset_with_fail() fi } =20 +start_events() +{ + mptcp_lib_events "${ns1}" "${evts_ns1}" evts_ns1_pid + mptcp_lib_events "${ns2}" "${evts_ns2}" evts_ns2_pid +} + reset_with_events() { reset "${1}" || return 1 =20 - mptcp_lib_events "${ns1}" "${evts_ns1}" evts_ns1_pid - mptcp_lib_events "${ns2}" "${evts_ns2}" evts_ns2_pid + start_events } =20 reset_with_tcp_filter() @@ -3406,6 +3411,36 @@ userspace_pm_chk_get_addr() fi } =20 +# $1: ns ; $2: event type ; $3: count +chk_evt_nr() +{ + local ns=3D${1} + local evt_name=3D"${2}" + local exp=3D"${3}" + + local evts=3D"${evts_ns1}" + local evt=3D"${!evt_name}" + local count + + evt_name=3D"${evt_name:16}" # without MPTCP_LIB_EVENT_ + [ "${ns}" =3D=3D "ns2" ] && evts=3D"${evts_ns2}" + + print_check "event ${ns} ${evt_name} (${exp})" + + if [[ "${evt_name}" =3D "LISTENER_"* ]] && + ! mptcp_lib_kallsyms_has "mptcp_event_pm_listener$"; then + print_skip "event not supported" + return + fi + + count=3D$(grep -cw "type:${evt}" "${evts}") + if [ "${count}" !=3D "${exp}" ]; then + fail_test "got ${count} events, expected ${exp}" + else + print_ok + fi +} + userspace_tests() { # userspace pm type prevents add_addr @@ -3648,6 +3683,7 @@ endpoint_tests() =20 if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT && mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then + start_events pm_nl_set_limits $ns1 0 3 pm_nl_set_limits $ns2 0 3 pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow @@ -3706,13 +3742,29 @@ endpoint_tests() =20 mptcp_lib_kill_wait $tests_pid =20 + kill_events_pids + chk_evt_nr ns1 MPTCP_LIB_EVENT_LISTENER_CREATED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_CREATED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0 + chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 3 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 3 + + chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 0 + chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 0 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 4 # one has been closed before= estab + join_syn_tx=3D6 \ chk_join_nr 5 5 5 chk_rm_nr 3 3 fi =20 # remove and re-add - if reset "delete re-add signal" && + if reset_with_events "delete re-add signal" && mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then pm_nl_set_limits $ns1 0 3 pm_nl_set_limits $ns2 3 3 @@ -3753,6 +3805,22 @@ endpoint_tests() chk_mptcp_info subflows 3 subflows 3 mptcp_lib_kill_wait $tests_pid =20 + kill_events_pids + chk_evt_nr ns1 MPTCP_LIB_EVENT_LISTENER_CREATED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_CREATED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0 + chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 0 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 2 + + chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 5 + chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 3 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + join_connect_err=3D1 \ chk_join_nr 4 4 4 chk_add_nr 5 5 diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing= /selftests/net/mptcp/mptcp_lib.sh index 438280e68434..4578a331041e 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -12,10 +12,14 @@ readonly KSFT_SKIP=3D4 readonly KSFT_TEST=3D"${MPTCP_LIB_KSFT_TEST:-$(basename "${0}" .sh)}" =20 # These variables are used in some selftests, read-only +declare -rx MPTCP_LIB_EVENT_CREATED=3D1 # MPTCP_EVENT_CREATED +declare -rx MPTCP_LIB_EVENT_ESTABLISHED=3D2 # MPTCP_EVENT_ESTABLISHED +declare -rx MPTCP_LIB_EVENT_CLOSED=3D3 # MPTCP_EVENT_CLOSED declare -rx MPTCP_LIB_EVENT_ANNOUNCED=3D6 # MPTCP_EVENT_ANNOUNCED declare -rx MPTCP_LIB_EVENT_REMOVED=3D7 # MPTCP_EVENT_REMOVED declare -rx MPTCP_LIB_EVENT_SUB_ESTABLISHED=3D10 # MPTCP_EVENT_SUB_ESTABL= ISHED declare -rx MPTCP_LIB_EVENT_SUB_CLOSED=3D11 # MPTCP_EVENT_SUB_CLOSED +declare -rx MPTCP_LIB_EVENT_SUB_PRIORITY=3D13 # MPTCP_EVENT_SUB_PRIORI= TY declare -rx MPTCP_LIB_EVENT_LISTENER_CREATED=3D15 # MPTCP_EVENT_LISTENER_C= REATED declare -rx MPTCP_LIB_EVENT_LISTENER_CLOSED=3D16 # MPTCP_EVENT_LISTENER_C= LOSED =20 --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 11FE2BA53 for ; Thu, 15 Aug 2024 20:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754774; cv=none; b=kndqoamlbU1zQpsuGbC2ugYkpbdQKKJ+zpD1PrWxY2weApMChiyevFpbRX2nJ57IA+DnPY6utZlz/FgLe5r35z2CiKo17nJL6n+s30e4vWhkqP9QcToyBaFihnktjh/XWQ3eaOWuI2cF3QZ8Gvl9/SwfRBjv86EykeM8d7k6++4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754774; c=relaxed/simple; bh=z57vK/npD85awZLCg7BAbTqJ+9Cm06pVvgq7mys/q4g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dGAhgdoRWGzpGwU9ebHWbo16yBQ5upsZDZFYpWLUyEEWQb2A9fMLXrW8dbGtUd5OYKp5nkPDAMU+SczRQz6VpTMyhvG6rpHbAhVAk3QtAKha30exYfwGIPo1QZZab4LBh7zRBJ63EdfKSMhiy/lCZjllaAjqHi9FWESGiazHJ7A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cv3jYWQ3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cv3jYWQ3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E63BFC4AF10; Thu, 15 Aug 2024 20:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754773; bh=z57vK/npD85awZLCg7BAbTqJ+9Cm06pVvgq7mys/q4g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cv3jYWQ3UT2oHMoBy7PdSSk3JZBWLXRYUv/fuNkthuNva/BF21hagnLl6yPDneczp 3CkFvhqXxWkPBHJRs+za5TkBUYByydA7u1yEhXvOnKv8UMZt7qaLT/tNjpjLWReoPM XmxHZz78NtSfokWw8KlhwR2lJ1QqIQFykFXvDbAyIMj7qqjt9fOrV9BVYUSc4lBZvN 5q37tAuBqJ74+361OaLJOfCrzIQoasw0bZ6NMadHfjyE1BjfbzsYoIrgPIB6X47/6L GR+1PXGvBQPrW78VSJUhfPZYSAndGpNQPSl3LjkxPIrQlORGKeCmQ8QnrfJmbzjWHO SVPCFUfNDXR8Q== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:50 +0200 Subject: [PATCH mptcp-net 09/10] mptcp: pm: ADD_ADDR 0 is not a new address Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-9-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3254; i=matttbe@kernel.org; h=from:subject:message-id; bh=z57vK/npD85awZLCg7BAbTqJ+9Cm06pVvgq7mys/q4g=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJ+eide7Z3KoSm7Yo1xaiKmllA0VW/bwnWn T4TbZTkM12JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c5HAEADVA+vh6hZbib7rVICONswZ+79Bq5zXcB9r3lJfaPNq66JSHA81Xn1r9vSouKLlMUjH8KL +tDbWMH6pbQbehkvtqKvpOdHAkG0Pm7f+yi765ZXsV4ees6SCtN9iNjdVqiv82v8Cwb3S30PId2 sFefeCgRR4avpVvaK8RoU0X1P9y0BkZxmb7o6oHVZWrmYgmDPIiqydJ+Cm4dX6KV992wCaMDQeW n/k5egRz92OXx+EXwmOe0P58QQBdtLIB1+3PeG3ft9sAdniFPcr7eSijsAockpSTxfPJWPitukr XRb6nCSfuB7QQYKCwaGwQREJd6e6wSPKX4/pQidNZHSYAsvlcN3wIfPkEmzja1JdvnYje0Ib2Pj pLSaUsUM/UF5Uj0Hun8iQNs4vzD87mJKERc3tjl4D5Pjbmdqp6cpZ+2xN+k+Dc0N7zAj4LKYc00 +8De9f7/ovQW+BuqMyOIewNPLOqSl5xlrXIHtKSOy/QPZgDVGA7Q3jQbHdo0IMpBHziqcPWGpDR prLMCaVpAu6cpYNB6JsEMhXzQg4Ejzuwl5M5A2armaw1jTXj/UfAXs/kehnSihWYUNl3ytR31ds S4gog7LVoBVQLIF2vh2KBXwcBRFqBz8zM/m5rXdm181qqI1Azxu6xTLAAOGpSfsC2d61ZuLiWGe zo6ORERmLeCESuA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 The ADD_ADDR 0 with the address from the initial subflow should not be considered as a new address: this is not something new. If the host receives it, it simply means that the address is available again. When receiving an ADD_ADDR for the ID 0, the PM already doesn't consider it as new by not incrementing the 'add_addr_accepted' counter. But the 'accept_addr' might not be set if the limit has already been reached: this can be bypassed in this case. But before, it is important to check that this ADD_ADDR for the ID 0 is for the same address as the initial subflow. If not, it is not something that should happen, and the ADD_ADDR can be ignored. Note that if an ADD_ADDR is received while there is already a subflow opened using the same address, this ADD_ADDR is ignored as well. It means that if multiple ADD_ADDR for ID 0 are received, there will not be any duplicated subflows created by the client. Fixes: d0876b2284cf ("mptcp: add the incoming RM_ADDR support") Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm.c | 4 +++- net/mptcp/pm_netlink.c | 9 +++++++++ net/mptcp/protocol.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 56c0a318e5df..da7b2b95d568 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -226,7 +226,9 @@ void mptcp_pm_add_addr_received(const struct sock *ssk, } else { __MPTCP_INC_STATS(sock_net((struct sock *)msk), MPTCP_MIB_ADDADDRDROP); } - } else if (!READ_ONCE(pm->accept_addr)) { + /* id0 should not have a different address */ + } else if ((addr->id =3D=3D 0 && !mptcp_pm_nl_is_init_remote_addr(msk, ad= dr)) || + (addr->id > 0 && !READ_ONCE(pm->accept_addr))) { mptcp_pm_announce_addr(msk, addr, true); mptcp_pm_add_addr_send_ack(msk); } else if (mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_RECEIVED)) { diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index e44f539e6a56..34af04685e26 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -764,6 +764,15 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp= _sock *msk) } } =20 +bool mptcp_pm_nl_is_init_remote_addr(struct mptcp_sock *msk, + const struct mptcp_addr_info *remote) +{ + struct mptcp_addr_info mpc_remote; + + remote_address((struct sock_common *)msk, &mpc_remote); + return mptcp_addresses_equal(&mpc_remote, remote, remote->port); +} + void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk) { struct mptcp_subflow_context *subflow; diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index ce15e7db464b..c05c5a3cb07e 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1004,6 +1004,8 @@ void mptcp_pm_add_addr_received(const struct sock *ss= k, void mptcp_pm_add_addr_echoed(struct mptcp_sock *msk, const struct mptcp_addr_info *addr); void mptcp_pm_add_addr_send_ack(struct mptcp_sock *msk); +bool mptcp_pm_nl_is_init_remote_addr(struct mptcp_sock *msk, + const struct mptcp_addr_info *remote); void mptcp_pm_nl_addr_send_ack(struct mptcp_sock *msk); void mptcp_pm_rm_addr_received(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_list); --=20 2.45.2 From nobody Fri Nov 22 02:08:48 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 ED44014E2D8 for ; Thu, 15 Aug 2024 20:46:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754775; cv=none; b=pUOmfu8iQUdFZhaIEWJW5SKdIBh7SZbIP1/aA5gkwBmP0rDI8J7kon2xKhlJ7fZmKJmeBnf5fQlgpdrePL5h+ZD20DDiqWP/R/Urw0//Ta0xo1qQxHFx6nYONnrFCDnhjYd0PjgMmaw4NKdhvajiJrIorKUJMzC5mM38qQ9uTDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723754775; c=relaxed/simple; bh=Wf1RCXTiAGBk18KGeZNdXyjIbjnYpfgbYHCeoTbkx7Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Zw55xO2y0kmq04G068FHEO02EjIOWWY5YYb10LTiQ87nAullsnXNZm+HG9G003G0WwERBgaSU9niD0/1pE7EA88qP1P7siOWnxnBP+1S6NpSz0uxJZoELfL2NGkEJ+k8h5kKugptymSSVRtXGcKihcJGHHRy0XhM8fOT1aFYhig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=of2EOt92; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="of2EOt92" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E1E2C4AF09; Thu, 15 Aug 2024 20:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723754774; bh=Wf1RCXTiAGBk18KGeZNdXyjIbjnYpfgbYHCeoTbkx7Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=of2EOt92ByIa1slpeAYta01fpnWPizu5SUx33HuYnoc+C5VpmCVbk4rmCSVizFdGI 6RKJhNb68cc3CkWEWDG8fy/Sg9FxAhc3Ijx2yINj35yaFyD4m4bGzE42uO2aCOJBsN m0tAUzjMmD20tJsoy3TAQJw2cUjLQ9cyXs3wweDBbc3WYkl10CbBnFWHVJftJPCiKG RYQ/XaytaPPm2g9KtaF0Fn8qUuc7cdYnuFK1xZZZLPsRICBF5ulz+G7uQzn8dncVw1 Q0ONmSSaCUZfIlfRO1x5AHrirZdc1JwY7WYUACPUwtNAI7F8AV/kM/OusYxAPfaLSY A2ALXoGfX49kQ== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Aug 2024 22:45:51 +0200 Subject: [PATCH mptcp-net 10/10] selftests: mptcp: join: check re-re-adding ID 0 signal Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240815-mptcp-dup-close-evt-v1-10-5a551d3a66cc@kernel.org> References: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> In-Reply-To: <20240815-mptcp-dup-close-evt-v1-0-5a551d3a66cc@kernel.org> To: mptcp@lists.linux.dev Cc: =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2790; i=matttbe@kernel.org; h=from:subject:message-id; bh=Wf1RCXTiAGBk18KGeZNdXyjIbjnYpfgbYHCeoTbkx7Q=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmvmkJlhLbVXHebRBl6D/SBn1o2bPDqa3zSWSs2 MkX8QYTqJ+JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZr5pCQAKCRD2t4JPQmmg c6WaEACWka5VE7FD96GArMyi3/AZgHDXwzkIoEfpSbV6rzu28jWlWmX83hvy3FQTQYw3mABPzy4 OYh1iiUeGETnJRbDegEjSYI7pKe5WcleYv/AID88KWMoxMiMj/3nLXwKH05fvwCHiFDErl+sdKC oFFOvetGagMNwQAtEbq2J62/5CRW1N9CA4hAFbw1ptY4tFomzH5mSL0OY46j0kVk9bErXFhbUnm LyQJyw3DMIAh8rI/ugAS/vGLLUkX2abRF4UDPuWYF8ClWcg74Tg9wryjIjjtH1UL6Yy5+9qmqKj OerA2zUVUi5cYLqTQe2YKpyxW9Bu4fzuPKDNnN97pxIG8/c3CIrboOCeyNQB+Zi3pyC7kmaLyfW RsTFWB8x4CeJ3ZVJJjX5+Nt3PULvvoIaidUyVhxjtSRXLbcMDSKmLYqYHn8uHuDni1fwGLiUidB bhtgcQtDcCF3EQHoZhhKYxjxa6RuUYkxFcOYr40GuIMvInIL/3s/X5fj6HEPpxLB16vL/+84om6 BvfyOc+LpeOa49m/7JDaqm8nnjL5cKiIUmfHG9cQc//tMgMEShjf1Axl6CU2KgKfWCJaYhqKpTr OKqMZRtjJMzYdXTNgmLTPeASyaeKMhcl9u4k0LYXAbgr52IiyL2+FDQrQEnqpV2LVxSsZTVyJsZ qKwGarFAIEsl/eA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This test extends "delete re-add signal" to validate the previous commit: when the 'signal' endpoint linked to the initial subflow (ID 0) is re-added multiple times, it will re-send the ADD_ADDR with id 0. The client should still be able to re-create this subflow, even if the add_addr_accepted limit has been reached as this special address is not considered as a new address. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: d0876b2284cf ("mptcp: add the incoming RM_ADDR support") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 30 ++++++++++++++++-----= ---- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 9e064c518fb8..9cd0130685d8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3801,7 +3801,17 @@ endpoint_tests() =20 pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal wait_mpj $ns2 - chk_subflow_nr "after re-add" 3 + chk_subflow_nr "after re-add ID 0" 3 + chk_mptcp_info subflows 3 subflows 3 + + pm_nl_del_endpoint $ns1 99 10.0.1.1 + sleep 0.5 + chk_subflow_nr "after re-delete ID 0" 2 + chk_mptcp_info subflows 2 subflows 2 + + pm_nl_add_endpoint $ns1 10.0.1.1 id 88 flags signal + wait_mpj $ns2 + chk_subflow_nr "after re-re-add ID 0" 3 chk_mptcp_info subflows 3 subflows 3 mptcp_lib_kill_wait $tests_pid =20 @@ -3811,20 +3821,20 @@ endpoint_tests() chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0 chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 0 - chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4 - chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 3 =20 chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1 chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 - chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 5 - chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 3 - chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4 - chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 6 + chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 4 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 3 =20 join_connect_err=3D1 \ - chk_join_nr 4 4 4 - chk_add_nr 5 5 - chk_rm_nr 3 2 invert + chk_join_nr 5 5 5 + chk_add_nr 6 6 + chk_rm_nr 4 3 invert fi =20 # flush and re-add --=20 2.45.2