IFF_RUNNING and hostapd
Mon Oct 25 11:40:56 PDT 2010
On -10/01/37 20:59, Dave Taht wrote:
> I recently configured an openwrt system (a nanostation M) as a pure
> router, not bridge, in AP mode.
> Neither babeld (with link detection enabled) and radvd work
> (preventing ipv6 from working entirely)
> ip addr
> for wlan0 shows the interface as UP, but with "NO CARRIER".
> In poking through the iproute2 code, it showed that the UP bit being
> set on the interface and the IFF_RUNNING bit not being set = "NO
> It doesn't look like the hostapd I'm using sets the IFF_RUNNING bit, ever.
I have discovered exactly the very same, also using OpenWRT on a TP-Link
TP-WR1043ND (v1.7). I discovered this when trying to setup radvd.
Others have reported this in this Trac ticket on OpenWRT:
root at router:~# ip link show wlan0
20: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
mq state DORMANT qlen 1000
link/ether 8f:f2:13:9a:7a:15 brd ff:ff:ff:ff:ff:ff
root at router:~#
I'm also using ath9k and the nl80211 driver.
This is still the case even after having connected clients to the
wireless router, authenticated successfully etc, etc. But radvd
declines to start because the interface is dormant (not in IFF_RUNNING
I've tried both bridged (by adding 'option type bridge' in the openwrt
network config, which does setup the bridge properly, configuring
hostapd and radvd accordingly and correct) and non-bridged setup.
In non-bridged setup radvd does not start up at all. In bridged mode
radvd starts up, but it prints regularly messages like the one below:
Oct 25 20:32:37 router daemon.warn radvd: sendmsg: Operation not
In bridge mode, the br-wifi bridge is in RUNNING mode, while the wlan0
device is still in a dormant state.
> It seems like a good idea to leave it in the NO CARRIER state until
> the first client authenticates.
I do disagree with this, because that will not make it possible to start
radvd before at least one client has connected and the state has
changed. And what when the last client disconnects, should it go back
to NO-CARRIER (dormant state)?
I believe the state should be RUNNING as soon as the device is
configured and can be used, like when hostapd has configured the device
and is ready to process requests. NO-CARRIER basically should mean that
the device is not ready to do TX/RX. While being configured, it is
ready to do so.
More information about the Hostap