[PATCH] nl80211: Send RTM_SETLINK to the correct interface for extra BSSs
Jouni Malinen
j at w1.fi
Tue Sep 30 07:55:52 PDT 2025
On Wed, Jul 23, 2025 at 01:48:02PM +0200, Rafał Miłecki wrote:
> Modify wpa_driver_nl80211_set_operstate() to use BSS's ifindex instead
> of the main one. This results in calling RTM_SETLINK for interface that
> is actually used for a given BSS. It helps kernel to maintain proper
> "operstate" values.
>
> I noticed this "operstate" issue when working with wireless driver that
> doesn't happen to call netif helpers (like netif_carrier_on()). In such
> cases kernel doesn't update "operstate" properly on its own and hostapd
> can be helpful there.
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -7808,7 +7808,7 @@ static int wpa_driver_nl80211_set_operstate(void *priv, int state)
> bss->ifname, drv->operstate, state,
> state ? "UP" : "DORMANT");
> drv->operstate = state;
> - return netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, -1,
> + return netlink_send_oper_ifla(drv->global->netlink, bss->ifindex, -1,
> state ? IF_OPER_UP : IF_OPER_DORMANT);
Thanks. The same change went in from another contribution:
2bf6d85963b9 ("nl80211: Make processing RTM link event per-BSS")
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list