Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v2 1/2] l2tp: ppp: remove unused backlog callback
@ 2026-11-03  5:56 Qingfang Deng
  2026-11-03  5:56 ` [PATCH net-next v2 2/2] l2tp: unexport l2tp_udp_encap_recv() Qingfang Deng
  0 siblings, 1 reply; 2+ messages in thread
From: Qingfang Deng @ 2026-11-03  5:56 UTC (permalink / raw)
  To: James Chapman, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netdev, linux-kernel
  Cc: Linkui Xiao, Qingfang Deng, Sashiko

PPPoL2TP sessions receive packets through pppol2tp_recv(), which passes
packets directly to PPP or queues them on sk_receive_queue. No receive
path queues packets on the session socket backlog or calls
sk_receive_skb() with that socket, so pppol2tp_backlog_recv() is unused.

Remove the unused callback. L2TP/IP control sockets retain their
separate backlog callbacks.

Reported-by: Sashiko <netdev-bot+sashiko@kernel.org>
Closes: https://lore.kernel.org/netdev/179340002340.3131.5823454250644987437@kernel.org/
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
v2: repost after net-next is open, and add Sashiko's report

v1: https://lore.kernel.org/netdev/20261030070003.2590-1-qingfang.deng@linux.dev/
---
 net/l2tp/l2tp_ppp.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 4f311d473a64..15e02864bfd5 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -454,17 +454,6 @@ static struct proto pppol2tp_sk_proto = {
 	.obj_size = sizeof(struct pppox_sock),
 };
 
-static int pppol2tp_backlog_recv(struct sock *sk, struct sk_buff *skb)
-{
-	int rc;
-
-	rc = l2tp_udp_encap_recv(sk, skb);
-	if (rc)
-		kfree_skb(skb);
-
-	return NET_RX_SUCCESS;
-}
-
 /* socket() handler. Initialize a new struct sock.
  */
 static int pppol2tp_create(struct net *net, struct socket *sock, int kern)
@@ -482,7 +471,6 @@ static int pppol2tp_create(struct net *net, struct socket *sock, int kern)
 	sock->state  = SS_UNCONNECTED;
 	sock->ops    = &pppol2tp_ops;
 
-	sk->sk_backlog_rcv = pppol2tp_backlog_recv;
 	sk->sk_protocol	   = PX_PROTO_OL2TP;
 	sk->sk_family	   = PF_PPPOX;
 	sk->sk_state	   = PPPOX_NONE;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH net-next v2 2/2] l2tp: unexport l2tp_udp_encap_recv()
  2026-11-03  5:56 [PATCH net-next v2 1/2] l2tp: ppp: remove unused backlog callback Qingfang Deng
@ 2026-11-03  5:56 ` Qingfang Deng
  0 siblings, 0 replies; 2+ messages in thread
From: Qingfang Deng @ 2026-11-03  5:56 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Guillaume Nault, Michael Bommarito,
	Kuniyuki Iwashima, Alice Mikityanska, Qingfang Deng, Chengfeng Ye,
	David Bauer, netdev, linux-kernel
  Cc: Linkui Xiao

Removing pppol2tp_backlog_recv() eliminated the only caller outside
l2tp_core.c. Make l2tp_udp_encap_recv() static and remove its export
and declaration from l2tp_core.h.

Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
v2: new patch
---
 net/l2tp/l2tp_core.c | 3 +--
 net/l2tp/l2tp_core.h | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 7e042a3e648c..d575ebb97577 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1009,7 +1009,7 @@ static void l2tp_session_queue_purge(struct l2tp_session *session)
 }
 
 /* UDP encapsulation receive handler. See net/ipv4/udp.c for details. */
-int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
+static int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
 {
 	struct l2tp_session *session = NULL;
 	struct l2tp_tunnel *tunnel = NULL;
@@ -1108,7 +1108,6 @@ int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
 
 	return 1;
 }
-EXPORT_SYMBOL_GPL(l2tp_udp_encap_recv);
 
 /* UDP encapsulation receive error handler. See net/ipv4/udp.c for details. */
 static void l2tp_udp_encap_err_recv(struct sock *sk, struct sk_buff *skb, int err,
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index 25ae4c25d3ef..371aea239705 100644
--- a/net/l2tp/l2tp_core.h
+++ b/net/l2tp/l2tp_core.h
@@ -254,7 +254,6 @@ void l2tp_session_delete(struct l2tp_session *session);
 void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
 		      unsigned char *ptr, unsigned char *optr, u16 hdrflags,
 		      int length);
-int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb);
 
 /* Transmit path helpers for sending packets over the tunnel socket. */
 int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-03  5:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03  5:56 [PATCH net-next v2 1/2] l2tp: ppp: remove unused backlog callback Qingfang Deng
2026-11-03  5:56 ` [PATCH net-next v2 2/2] l2tp: unexport l2tp_udp_encap_recv() Qingfang Deng

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