Re: [PATCH] nl80211: Send RTM_SETLINK to the correct interface for extra BSSs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



W dniu 23.07.2025 o 13:48, Rafał Miłecki pisze:
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.

A kindly reminder about this small PATCH. Could someone review / accept
it, please?


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);
  }


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux