MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-net] mptcp: pm: do not remove closing subflows
@ 2024-08-30 15:36 Matthieu Baerts (NGI0)
  2024-09-02 17:43 ` MPTCP CI
  2024-10-07  9:19 ` Matthieu Baerts
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-08-30 15:36 UTC (permalink / raw)
  To: mptcp; +Cc: Paolo Abeni, Matthieu Baerts (NGI0)

In a previous fix, the in-kernel path-manager has been modified not to
retrigger the removal of a subflow if it was already closed, e.g. when
the initial subflow is removed, but kept in the subflows list.

To be complete, this fix should also skip the subflows that are in any
closing state: mptcp_close_ssk() will initiate the closure, but the
switch to the TCP_CLOSE state depends on the other peer.

Suggested-by: Paolo Abeni <pabeni@redhat.com>
Fixes: Fixes: 58e1b66b4e4b ("mptcp: pm: do not remove already closed subflows")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Notes:
- I'm not sure looking for TCPF_CLOSING is really needed in this case.
  I can remove it if it is not needed.
---
 net/mptcp/pm_netlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index a006ce39d41a..f52718e1c30c 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -862,7 +862,8 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
 			int how = RCV_SHUTDOWN | SEND_SHUTDOWN;
 			u8 id = subflow_get_local_id(subflow);
 
-			if (inet_sk_state_load(ssk) == TCP_CLOSE)
+			if ((1 << inet_sk_state_load(ssk)) &
+			    (TCPF_FIN_WAIT1 | TCPF_FIN_WAIT2 | TCPF_CLOSING | TCPF_CLOSE))
 				continue;
 			if (rm_type == MPTCP_MIB_RMADDR && remote_id != rm_id)
 				continue;

---
base-commit: 6b336f0e1c2b1f649f86fde82abeae5b87ce09b4
change-id: 20240830-mptcp-pm-minor-fixes-3578d0338438

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-07  9:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-30 15:36 [PATCH mptcp-net] mptcp: pm: do not remove closing subflows Matthieu Baerts (NGI0)
2024-09-02 17:43 ` MPTCP CI
2024-10-07  9:19 ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox