]> www.infradead.org Git - users/jedix/linux-maple.git/commit
l2tp: lookup tunnel from socket without using sk_user_data
authorJames Chapman <jchapman@katalix.com>
Mon, 29 Jul 2024 15:38:00 +0000 (16:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Jul 2024 08:25:12 +0000 (09:25 +0100)
commit2e7a280692bf43940728b7f6ca6a52ebf641a6f5
tree245f9eec940a74888e9621f741e6bb97a561da57
parent0a658d088cc63745528cf0ec8a2c2df0f37742d9
l2tp: lookup tunnel from socket without using sk_user_data

l2tp_sk_to_tunnel derives the tunnel from sk_user_data. Instead,
lookup the tunnel by walking the tunnel IDR for a tunnel using the
indicated sock. This is slow but l2tp_sk_to_tunnel is not used in
the datapath so performance isn't critical.

l2tp_tunnel_destruct needs a variant of l2tp_sk_to_tunnel which does
not bump the tunnel refcount since the tunnel refcount is already 0.

Change l2tp_sk_to_tunnel sk arg to const since it does not modify sk.

Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: Tom Parkin <tparkin@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c
net/l2tp/l2tp_core.h
net/l2tp/l2tp_ip.c
net/l2tp/l2tp_ip6.c