From ca68d8c427d6654a73e018ab85d6191d6bfb191e Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Sat, 2 May 2026 14:56:17 +0300 Subject: vlan_mon: bind ETH_P_ALL packet handler to init_net on kernels >= 6.6 The vlan_mon driver registers a global packet_type with type=ETH_P_ALL to intercept PADI/IP/ARP frames before they reach the protocol stack. Since Linux 6.6 the per-net-namespace ptype_all conversion (commit "net: af_packet: switch ptype_all to per-net-namespace lists") requires every ETH_P_ALL packet_type to have either ->dev or ->af_packet_net set; ptype_head() now does: WARN_ON_ONCE(!pt->af_packet_net && !pt->dev); return pt->dev ? &pt->dev->ptype_all : &pt->af_packet_net->ptype_all; With both fields NULL on our static vlan_pt, dev_add_pack() trips the WARN at module load and the handler is never linked into any usable list, so vlan_pt_recv() is never invoked. Userspace sets up the genetlink subscription correctly and gets a clean ACK from VLAN_MON_CMD_ADD, but no notifications ever arrive because the kernel side never sees the PADI. PPPoE-over-VLAN tests time out waiting for PADO. This was visible on Ubuntu's 6.17 azure kernel as a backtrace from vlan_mon_init -> dev_add_pack at net/core/dev.c:609 in dmesg, and as a silent failure of tests/accel-pppd/pppoe/test_pppoe_vlan_mon. Set vlan_pt.af_packet_net = &init_net before dev_add_pack() on kernels new enough to require it. The driver only operates in init_net anyway (all dev_get_by_index() calls are against &init_net), so this matches existing behaviour. Signed-off-by: Denys Fedoryshchenko --- drivers/vlan_mon/vlan_mon.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/vlan_mon/vlan_mon.c b/drivers/vlan_mon/vlan_mon.c index d5f42c91..8b699230 100644 --- a/drivers/vlan_mon/vlan_mon.c +++ b/drivers/vlan_mon/vlan_mon.c @@ -753,6 +753,9 @@ static int __init vlan_mon_init(void) } #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,6,0) + vlan_pt.af_packet_net = &init_net; +#endif dev_add_pack(&vlan_pt); return 0; -- cgit v1.2.3