ieee80211: set link state before notifying of link state change
authorRoy Marples <roy@marples.name>
Fri, 6 Sep 2019 22:41:30 +0000 (23:41 +0100)
committerRoy Marples <roy@marples.name>
Fri, 6 Sep 2019 22:44:47 +0000 (23:44 +0100)
Unknown link state is no good for any interface.
Set the state before calling out.
Now dhcpcd can see that wireless links are actually up

sys/netproto/802_11/wlan/ieee80211_dragonfly.c

index 71bc5f1..bc7e532 100644 (file)
@@ -757,6 +757,7 @@ ieee80211_notify_node_join(struct ieee80211_node *ni, int newassoc)
            (ni == vap->iv_bss) ? "bss " : "");
 
        if (ni == vap->iv_bss) {
+               ifp->if_link_state = LINK_STATE_UP;
                notify_macaddr(ifp, newassoc ?
                    RTM_IEEE80211_ASSOC : RTM_IEEE80211_REASSOC, ni->ni_bssid);
                if_link_state_change(ifp);
@@ -776,6 +777,7 @@ ieee80211_notify_node_leave(struct ieee80211_node *ni)
            (ni == vap->iv_bss) ? "bss " : "");
 
        if (ni == vap->iv_bss) {
+               ifp->if_link_state = LINK_STATE_DOWN;
                rt_ieee80211msg(ifp, RTM_IEEE80211_DISASSOC, NULL, 0);
                if_link_state_change(ifp);
        } else {