Message ID | 20240819-net-mptcp-pm-reusing-id-v1-10-38035d40de5b@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 0137a3c7c2ea3f9df8ebfc65d78b4ba712a187bb |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | mptcp: pm: fix IDs not being reusable | expand |
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 882781571c7b..28a9a3726146 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -848,8 +848,8 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk, /* Note: if the subflow has been closed before, this * add_addr_accepted counter will not be decremented. */ - msk->pm.add_addr_accepted--; - WRITE_ONCE(msk->pm.accept_addr, true); + if (--msk->pm.add_addr_accepted < mptcp_pm_get_add_addr_accept_max(msk)) + WRITE_ONCE(msk->pm.accept_addr, true); } } }