Commit 8df220b2 authored by Geliang Tang's avatar Geliang Tang Committed by Jakub Kicinski

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: 8b1c94da ("mptcp: only send RM_ADDR in nl_cmd_remove")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
Signed-off-by: default avatarMatthieu Baerts <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-3-7b9cd6a7b7f4@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d109a776
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment