@@ -1489,6 +1489,21 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list)
}
}
+void mptcp_pm_remove_subflows(struct mptcp_sock *msk, struct list_head *rm_list)
+{
+ struct mptcp_rm_list slist = { .nr = 0 };
+ struct mptcp_pm_addr_entry *entry;
+
+ list_for_each_entry(entry, rm_list, list) {
+ if (lookup_subflow_by_saddr(&msk->conn_list, &entry->addr) &&
+ slist.nr < MPTCP_RM_IDS_MAX)
+ slist.ids[slist.nr++] = entry->addr.id;
+ }
+
+ if (slist.nr)
+ mptcp_pm_remove_subflow(msk, &slist);
+}
+
static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
struct list_head *rm_list)
{
@@ -941,6 +941,7 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk,
int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_list);
int mptcp_pm_remove_subflow(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_list);
void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list);
+void mptcp_pm_remove_subflows(struct mptcp_sock *msk, struct list_head *rm_list);
void mptcp_userspace_pm_free_local_addr_list(struct mptcp_sock *msk);
Similar to mptcp_pm_remove_addrs(), this patch adds a new helper mptcp_pm_remove_subflows() to remove subflows related to addresses in the rm_list. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- net/mptcp/pm_netlink.c | 15 +++++++++++++++ net/mptcp/protocol.h | 1 + 2 files changed, 16 insertions(+)