Message ID | 20240906083043.1767111-2-matttbe@kernel.org (mailing list archive) |
---|---|
State | Mainlined, archived |
Delegated to: | Matthieu Baerts |
Headers | show |
Series | [5.15.y] mptcp: pm: check add_addr_accept_max before accepting new ADD_ADDR | expand |
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index eeda20ec161c..ceeb5fbe8d35 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -772,8 +772,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); } else if (rm_type == MPTCP_MIB_RMSUBFLOW) { msk->pm.local_addr_used--; }