[PATCH] VLAN: Open the link event socket only for a BSS that has VLANs

Jouni Malinen j at w1.fi
Wed Nov 18 01:27:40 PST 2026


On Wed, Nov 04, 2026 at 09:37:45AM -0600, Christopher Griffin via B4 Relay wrote:
> vlan_init() opens a NETLINK_ROUTE socket in the RTMGRP_LINK group for
> every BSS when hostapd is built with CONFIG_FULL_DYNAMIC_VLAN, whether
> or not the BSS uses VLANs. Its events matter only to the BSS's VLAN
> interfaces: vlan_newlink() and vlan_dellink() match them against
> conf->vlan. A BSS with dynamic_vlan disabled, no per_sta_vif and no
> VLAN list receives every link event in the system and uses none. When
> hostapd is busy during a burst of link events, each of these sockets
> overflows, and each BSS logs "VLAN: vlan_event_receive: recvfrom
> failed: No buffer space available" at error level.
> 
> Open the socket only when the BSS can have VLAN interfaces. The rest
> of the VLAN setup in vlan_init() already depends on the same settings,
> and vlan_init() runs only at BSS setup.
> 
> Tested on OpenWrt (wpad, 4 BSSes without VLANs, on an Arista W-318).
> hostapd held 5 NETLINK_ROUTE link sockets before (one per BSS and the
> driver's) and 1 after. With hostapd stopped during 1000 up/down
> toggles of a test bridge, the 4 per-BSS sockets overflowed and each
> logged the error. With this change only the driver's socket
> overflowed; it logs "netlink: Link events lost, request the link
> state" and recovers.

Thanks, applied.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list