diff mbox series

[v2,mptcp-next,2/3] mptcp: skip closing the initial subsocket

Message ID 25ac6aa2d37f0a06f0c6df69419bfe707bf90fc5.1614068181.git.geliangtang@gmail.com
State Superseded, archived
Headers show
Series remove id 0 address | expand

Commit Message

Geliang Tang Feb. 23, 2021, 8:26 a.m. UTC
If the removing address id is 0, skip invoking mptcp_close_ssk to close
the initial subsocket.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 net/mptcp/pm_netlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 85417b0e73fe..b5cee3c66e5c 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -631,7 +631,8 @@  static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
 				 type == RM_ADDR ? "address" : "subflow", i, rm_list.ids[i]);
 			spin_unlock_bh(&msk->pm.lock);
 			mptcp_subflow_shutdown(sk, ssk, how);
-			mptcp_close_ssk(sk, ssk, subflow);
+			if (rm_list.ids[i])
+				mptcp_close_ssk(sk, ssk, subflow);
 			spin_lock_bh(&msk->pm.lock);
 
 			if (type == RM_ADDR) {