summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2023-07-25 11:34:56 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-03 10:26:12 +0200
commitc58951ccef60301225f0706a45802e19d8fc03e4 (patch)
tree40abe73610398badcbeea45397b7f096abac00fe
parent8aba7fb2544ac6de5ce18a66dd0b6f8c5ca6433c (diff)
downloadlinux-stable-c58951ccef60301225f0706a45802e19d8fc03e4.tar.gz
linux-stable-c58951ccef60301225f0706a45802e19d8fc03e4.tar.bz2
linux-stable-c58951ccef60301225f0706a45802e19d8fc03e4.zip
mptcp: more accurate NL event generation
commit 21d9b73a7d5241905367098d260a3c68b811da32 upstream. 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. Cc: stable@vger.kernel.org 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> Link: https://lore.kernel.org/r/20230725-send-net-20230725-v1-2-6f60fe7137a9@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/mptcp/protocol.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b069826869d0..f2eeb8a850af 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3717,10 +3717,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;