Page MenuHomeFreeBSD

net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING

Authored by avg on Wed, May 20, 6:53 AM.



This is useful when a wireless driver is stopped or started in response
to events like an RF Kill button press.
Applications like wpa_supplicant depend on such events to have
a correct view of interface state.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

avg created this revision.Wed, May 20, 6:53 AM
avg requested review of this revision.Wed, May 20, 6:53 AM
cy accepted this revision.Wed, May 20, 2:36 PM


Works on iwn.

Maybe I'm wrong but I seem to have a foggy recollection that this used to work.

This revision is now accepted and ready to land.Wed, May 20, 2:36 PM

It likely worked via polling the interface state or something.

I've noticed a bunch of other un-fun issues where dhclient stops noticing the interface state change so it starts re-doing DHCP.. should look into that too to see what's up.

1633 ↗(On Diff #72019)

So to try and keep this portable, I suggest making the call to rt_ifmsg() a method that you add to ieee80211_freebsd.c . That way the other downstream consumers of net80211 (dragonflybsd and haiku to name two) can decide how they want to handle it.

That also potentially keeps the CURVNET_SET/RESTORE calls in _freebsd.c, hiding it from OSes that don't use it.

avg updated this revision to Diff 72069.Thu, May 21, 8:04 AM

do not call rt_ifmsg directly, wrap it under ieee80211_notify_ifnet_change

This revision now requires review to proceed.Thu, May 21, 8:04 AM
avg added a comment.Thu, May 21, 8:05 AM

@adrian, is this closer to what you have in mind?

adrian accepted this revision.Thu, May 21, 3:03 PM


This revision is now accepted and ready to land.Thu, May 21, 3:03 PM
emaste added a subscriber: emaste.Thu, May 21, 7:08 PM
melifaro accepted this revision.Fri, May 22, 7:58 AM