MPTCP Linux Development
 help / color / mirror / Atom feed
* [MPTCP] [PATCH mptcp 2/3] mptcp: skip MPTCP_EVENT_SUB_CLOSED event when mptcp socket isn't established
@ 2021-02-02 17:47 Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2021-02-02 17:47 UTC (permalink / raw)
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

A CLOSE event will be sent when the logical mptcp socket is closing.
Thus there is no need to generate individual subflow close events
if the mptcp socket isn't established anymore.

Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/protocol.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b5ba832ca58b..24eb42a60844 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2150,7 +2150,8 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
 void mptcp_close_ssk(struct sock *sk, struct sock *ssk,
 		     struct mptcp_subflow_context *subflow)
 {
-	mptcp_event(MPTCP_EVENT_SUB_CLOSED, mptcp_sk(sk), ssk, GFP_KERNEL);
+	if (sk->sk_state == TCP_ESTABLISHED)
+		mptcp_event(MPTCP_EVENT_SUB_CLOSED, mptcp_sk(sk), ssk, GFP_KERNEL);
 	__mptcp_close_ssk(sk, ssk, subflow);
 }
 
-- 
2.26.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-02 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-02 17:47 [MPTCP] [PATCH mptcp 2/3] mptcp: skip MPTCP_EVENT_SUB_CLOSED event when mptcp socket isn't established Florian Westphal

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