[PATCH] wired: Monitor link state via rtnetlink
Jouni Malinen
j at w1.fi
Sun Nov 15 13:11:53 PST 2026
On Tue, Sep 29, 2026 at 10:02:39AM +0300, Alexei Lazar wrote:
> Subscribe to RTM_NEWLINK events via the existing netlink abstraction to
> detect IFF_UP/IFF_LOWER_UP transitions on the wired interface. When the
> combined flag state changes, emit EVENT_INTERFACE_ENABLED or
> EVENT_INTERFACE_DISABLED so wpa_supplicant can react to cable
> plug/unplug events without relying on polling.
>
> After enabling link-change notifications, seed the driver's cached link
> state from sysfs at startup. Blindly treating the link as up would cause
> the first cable-plug event to be missed when the interface starts
> without carrier.
>
> Linux-specific parts are guarded with __linux__ since driver_wired
> supports other platforms. CONFIG_DRIVER_WIRED now sets NEED_NETLINK so
> wired-only builds link against netlink_init()/netlink_deinit().
> netlink_init() does not take ownership of cfg; free it on failure.
Thanks, applied.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list