Skip to content

Commit 8df220b

Browse files
geliangtangkuba-moo
authored andcommitted
mptcp: add validity check for sending RM_ADDR
This patch adds the validity check for sending RM_ADDRs for userspace PM in mptcp_pm_remove_addrs(), only send a RM_ADDR when the address is in the anno_list or conn_list. Fixes: 8b1c94d ("mptcp: only send RM_ADDR in nl_cmd_remove") Cc: stable@vger.kernel.org Signed-off-by: Geliang Tang <geliang.tang@suse.com> Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts <matttbe@kernel.org> Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-3-7b9cd6a7b7f4@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent d109a77 commit 8df220b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

net/mptcp/pm_netlink.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,8 +1515,9 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
15151515
struct mptcp_pm_addr_entry *entry;
15161516

15171517
list_for_each_entry(entry, rm_list, list) {
1518-
remove_anno_list_by_saddr(msk, &entry->addr);
1519-
if (alist.nr < MPTCP_RM_IDS_MAX)
1518+
if ((remove_anno_list_by_saddr(msk, &entry->addr) ||
1519+
lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) &&
1520+
alist.nr < MPTCP_RM_IDS_MAX)
15201521
alist.ids[alist.nr++] = entry->addr.id;
15211522
}
15221523

0 commit comments

Comments
 (0)