]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mptcp: fix address removal logic in mptcp_pm_nl_rm_addr
authorGang Yan <yangang@kylinos.cn>
Tue, 18 Nov 2025 07:20:28 +0000 (08:20 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 20 Nov 2025 04:07:15 +0000 (20:07 -0800)
Fix inverted WARN_ON_ONCE condition that prevented normal address
removal counter updates. The current code only executes decrement
logic when the counter is already 0 (abnormal state), while
normal removals (counter > 0) are ignored.

Signed-off-by: Gang Yan <yangang@kylinos.cn>
Fixes: 636113918508 ("mptcp: pm: remove '_nl' from mptcp_pm_nl_rm_addr_received")
Cc: stable@vger.kernel.org
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20251118-net-mptcp-misc-fixes-6-18-rc6-v1-10-806d3781c95f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_kernel.c

index 2ae95476dba35e00f88ae83ca64ee2bd1eef5cb6..0a50fd5edc06db946f7652a505b854055f9f38c9 100644 (file)
@@ -672,7 +672,7 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
 
 void mptcp_pm_nl_rm_addr(struct mptcp_sock *msk, u8 rm_id)
 {
-       if (rm_id && WARN_ON_ONCE(msk->pm.add_addr_accepted == 0)) {
+       if (rm_id && !WARN_ON_ONCE(msk->pm.add_addr_accepted == 0)) {
                u8 limit_add_addr_accepted =
                        mptcp_pm_get_limit_add_addr_accepted(msk);