Skip to content

Commit

Permalink
mptcp: add validity check for sending RM_ADDR
Browse files Browse the repository at this point in the history
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")
Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
geliangtang authored and intel-lab-lkp committed Nov 3, 2023
1 parent bbb2b19 commit 4756395
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/mptcp/pm_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1515,8 +1515,9 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
struct mptcp_pm_addr_entry *entry;

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

Expand Down

0 comments on commit 4756395

Please sign in to comment.