From: Mat Martineau <martineau@kernel.org>
To: Matthieu Baerts <matthieu.baerts@tessares.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Geliang Tang <geliang.tang@suse.com>
Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
stable@vger.kernel.org, Mat Martineau <martineau@kernel.org>
Subject: [PATCH net 2/2] mptcp: more accurate NL event generation
Date: Tue, 25 Jul 2023 11:34:56 -0700 [thread overview]
Message-ID: <20230725-send-net-20230725-v1-2-6f60fe7137a9@kernel.org> (raw)
In-Reply-To: <20230725-send-net-20230725-v1-0-6f60fe7137a9@kernel.org>
From: Paolo Abeni <pabeni@redhat.com>
Currently the mptcp code generate a "new listener" event even
if the actual listen() syscall fails. Address the issue moving
the event generation call under the successful branch.
Fixes: f8c9dfbd875b ("mptcp: add pm listener events")
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
net/mptcp/protocol.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 3613489eb6e3..3317d1cca156 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3723,10 +3723,9 @@ static int mptcp_listen(struct socket *sock, int backlog)
if (!err) {
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
mptcp_copy_inaddrs(sk, ssock->sk);
+ mptcp_event_pm_listener(ssock->sk, MPTCP_EVENT_LISTENER_CREATED);
}
- mptcp_event_pm_listener(ssock->sk, MPTCP_EVENT_LISTENER_CREATED);
-
unlock:
release_sock(sk);
return err;
--
2.41.0
next prev parent reply other threads:[~2023-07-25 18:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 18:34 [PATCH net 0/2] mptcp: More fixes for 6.5 Mat Martineau
2023-07-25 18:34 ` [PATCH net 1/2] selftests: mptcp: join: only check for ip6tables if needed Mat Martineau
2023-07-25 18:39 ` Greg KH
2023-07-25 21:08 ` Mat Martineau
2023-07-25 18:34 ` Mat Martineau [this message]
2023-07-25 18:39 ` [PATCH net 2/2] mptcp: more accurate NL event generation Greg KH
2023-07-25 22:27 ` [PATCH net 0/2] mptcp: More fixes for 6.5 Jakub Kicinski
2023-07-27 1:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230725-send-net-20230725-v1-2-6f60fe7137a9@kernel.org \
--to=martineau@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geliang.tang@suse.com \
--cc=kuba@kernel.org \
--cc=matthieu.baerts@tessares.net \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).