diff options
Diffstat (limited to 'sys/net80211/ieee80211_proto.c')
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index c6bea58320d..a3ed1a2c299 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.90 2018/09/11 10:23:40 krw Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.91 2018/11/12 16:36:54 krw Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -48,6 +48,7 @@ #include <net/if_dl.h> #include <net/if_media.h> #include <net/if_llc.h> +#include <net/route.h> #include <netinet/in.h> #include <netinet/if_ether.h> @@ -1198,6 +1199,20 @@ ieee80211_set_link_state(struct ieee80211com *ic, int nstate) } if (nstate != ifp->if_link_state) { ifp->if_link_state = nstate; + if (LINK_STATE_IS_UP(nstate)) { + struct if_ieee80211_data ifie; + memset(&ifie, 0, sizeof(ifie)); + ifie.ifie_nwid_len = ic->ic_bss->ni_esslen; + memcpy(ifie.ifie_nwid, ic->ic_bss->ni_essid, + sizeof(ifie.ifie_nwid)); + memcpy(ifie.ifie_addr, ic->ic_bss->ni_bssid, + sizeof(ifie.ifie_addr)); + ifie.ifie_channel = ieee80211_chan2ieee(ic, + ic->ic_bss->ni_chan); + ifie.ifie_flags = ic->ic_flags; + ifie.ifie_xflags = ic->ic_xflags; + rtm_80211info(&ic->ic_if, &ifie); + } if_link_state_change(ifp); } } |