summaryrefslogtreecommitdiffstats
path: root/net/l2tp
diff options
context:
space:
mode:
authorJames Chapman <jchapman@katalix.com>2024-06-20 12:22:41 +0100
committerDavid S. Miller <davem@davemloft.net>2024-06-21 11:33:33 +0100
commitc37e0138ca5f3be6b69c3020470aecb94eb5d773 (patch)
tree5c722859fe28a05c657b9a1c09a5d099708d3de0 /net/l2tp
parentff6a2ac23cb027ff9980d633412db17d5f7a1e7c (diff)
downloadlinux-c37e0138ca5f3be6b69c3020470aecb94eb5d773.tar.gz
linux-c37e0138ca5f3be6b69c3020470aecb94eb5d773.tar.bz2
linux-c37e0138ca5f3be6b69c3020470aecb94eb5d773.zip
l2tp: don't use sk_user_data in l2tp_udp_encap_err_recv
If UDP sockets are aliased, sk might be the wrong socket. There's no benefit to using sk_user_data to do some checks on the associated tunnel context. Just report the error anyway, like udp core does. Signed-off-by: James Chapman <jchapman@katalix.com> Reviewed-by: Tom Parkin <tparkin@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp')
-rw-r--r--net/l2tp/l2tp_core.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 2c6378a9f384..cbc5de1373cd 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1030,12 +1030,6 @@ EXPORT_SYMBOL_GPL(l2tp_udp_encap_recv);
static void l2tp_udp_encap_err_recv(struct sock *sk, struct sk_buff *skb, int err,
__be16 port, u32 info, u8 *payload)
{
- struct l2tp_tunnel *tunnel;
-
- tunnel = rcu_dereference_sk_user_data(sk);
- if (!tunnel || tunnel->fd < 0)
- return;
-
sk->sk_err = err;
sk_error_report(sk);