diff options
author | Tobias Tschinkowitz <tobias@he4d.net> | 2018-05-31 13:53:49 +0200 |
---|---|---|
committer | Aaron Marcher <me@drkhsh.at> | 2018-05-31 15:10:04 +0200 |
commit | 8c8091f4f165974c44d75dd9ccc7cc4dcd1d1c96 (patch) | |
tree | 51ce46eb9f6ed9707206df351939639aecf067bc /components/wifi.c | |
parent | b0401b13bb78bacde9d10b00766830cbeb2c90f6 (diff) |
wifi: fixed disconnected wifi status on openbsd
Diffstat (limited to 'components/wifi.c')
-rw-r--r-- | components/wifi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/wifi.c b/components/wifi.c index 7815c86..3751ae3 100644 --- a/components/wifi.c +++ b/components/wifi.c @@ -109,6 +109,7 @@ { struct ieee80211_bssid bssid; int sockfd; + uint8_t zero_bssid[IEEE80211_ADDR_LEN]; memset(&bssid, 0, sizeof(bssid)); memset(nr, 0, sizeof(struct ieee80211_nodereq)); @@ -122,6 +123,12 @@ close(sockfd); return 0; } + memset(&zero_bssid, 0, sizeof(zero_bssid)); + if (memcmp(bssid.i_bssid, zero_bssid, + IEEE80211_ADDR_LEN) == 0) { + close(sockfd); + return 0; + } strlcpy(nr->nr_ifname, iface, sizeof(nr->nr_ifname)); memcpy(&nr->nr_macaddr, bssid.i_bssid, sizeof(nr->nr_macaddr)); if ((ioctl(sockfd, SIOCG80211NODE, nr)) < 0 && nr->nr_rssi) { |