diff mbox series

[mptcp-next,v13,21/32] mptcp: rm addrs and subflows before free local list

Message ID 3ae3b61c487a73f3ed7f9b677a6278c401ad710f.1701180969.git.geliang.tang@suse.com (mailing list archive)
State Superseded, archived
Headers show
Series userspace pm enhancements | expand

Checks

Context Check Description
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
matttbe/build success Build and static analysis OK
matttbe/KVM_Validation__normal__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__normal__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__except_selftest_mptcp_join_ success Success! ✅

Commit Message

Geliang Tang Nov. 28, 2023, 2:22 p.m. UTC
Before freeing addresses in userspace_pm_local_addr_list(), RM_ADDRs for
the addresses should be sent and the subflows established with these
addresses should be deleted.

This patch invokes mptcp_pm_remove_addrs() and mptcp_pm_remove_subflows()
in mptcp_userspace_pm_free_local_addr_list() to remove the related
addresses and subflows.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/pm_userspace.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 87cf27dc1d0a..674262face65 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -20,6 +20,9 @@  void mptcp_userspace_pm_free_local_addr_list(struct mptcp_sock *msk)
 	list_splice_init(&msk->pm.userspace_pm_local_addr_list, &free_list);
 	spin_unlock_bh(&msk->pm.lock);
 
+	mptcp_pm_remove_addrs(msk, &free_list);
+	mptcp_pm_remove_subflows(msk, &free_list);
+
 	list_for_each_entry_safe(entry, tmp, &free_list, list) {
 		sock_kfree_s(sk, entry, sizeof(*entry));
 	}