Skip to content

Commit 0137a3c

Browse files
matttbekuba-moo
authored andcommitted
mptcp: pm: check add_addr_accept_max before accepting new ADD_ADDR
The limits might have changed in between, it is best to check them before accepting new ADD_ADDR. Fixes: d0876b2 ("mptcp: add the incoming RM_ADDR support") Cc: [email protected] Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1c1f721 commit 0137a3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/mptcp/pm_netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,8 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
848848
/* Note: if the subflow has been closed before, this
849849
* add_addr_accepted counter will not be decremented.
850850
*/
851-
msk->pm.add_addr_accepted--;
852-
WRITE_ONCE(msk->pm.accept_addr, true);
851+
if (--msk->pm.add_addr_accepted < mptcp_pm_get_add_addr_accept_max(msk))
852+
WRITE_ONCE(msk->pm.accept_addr, true);
853853
}
854854
}
855855
}

0 commit comments

Comments
 (0)