diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-02 14:56:17 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-02 14:56:26 +0300 |
| commit | ca68d8c427d6654a73e018ab85d6191d6bfb191e (patch) | |
| tree | a0cb4289c2b86c65443fdb236892cd96fc6b3cf2 | |
| parent | 06f64b19a123d623438b95b5e6da00f4bf4ce9c1 (diff) | |
| download | accel-ppp-ca68d8c427d6654a73e018ab85d6191d6bfb191e.tar.gz accel-ppp-ca68d8c427d6654a73e018ab85d6191d6bfb191e.zip | |
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 <denys.f@collabora.com>
| -rw-r--r-- | drivers/vlan_mon/vlan_mon.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |
