From: Rafał Miłecki <rafal@xxxxxxxxxx> 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. Before: $ grep . /sys/class/net/wlan*/operstate /sys/class/net/wlan0-1/operstate:unknown /sys/class/net/wlan0/operstate:up /sys/class/net/wlan1-1/operstate:unknown /sys/class/net/wlan1/operstate:up After: $ grep . /sys/class/net/wlan*/operstate /sys/class/net/wlan0-1/operstate:up /sys/class/net/wlan0/operstate:up /sys/class/net/wlan1-1/operstate:up /sys/class/net/wlan1/operstate:up Signed-off-by: Rafał Miłecki <rafal@xxxxxxxxxx> --- src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0cc5b4b0e..ebd93d856 100644 --- 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); } -- 2.43.0 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap