🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
3 messages
3 total messages Started by Qingfang Deng Tue, 03 Nov 2026 05:56
[PATCH net-next v2 1/2] l2tp: ppp: remove unused backlog callback
#10080
Author: Qingfang Deng
Date: Tue, 03 Nov 2026 05:56
52 lines
9627 bytes
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
[PATCH net-next v2 2/2] l2tp: unexport l2tp_udp_encap_recv()
#10081
Author: Qingfang Deng
Date: Tue, 03 Nov 2026 05:56
48 lines
9817 bytes
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
Re: [PATCH net-next v2 1/2] l2tp: ppp: remove unused backlog callback
#11763
Author: patchwork-bot+netdevbpf
Date: Thu, 05 Nov 2026 14:00
27 lines
8833 bytes
Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue,  3 Nov 2026 13:56:11 +0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/2] l2tp: ppp: remove unused backlog callback
    https://git.kernel.org/netdev/net-next/c/7c43105da5fc
  - [net-next,v2,2/2] l2tp: unexport l2tp_udp_encap_recv()
    https://git.kernel.org/netdev/net-next/c/ae54bc28fc9e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads