all repos — slstatus @ 8c8091f4f165974c44d75dd9ccc7cc4dcd1d1c96

my build of slstatus (tools.suckless.org/slstatus/)

wifi: fixed disconnected wifi status on openbsd
Tobias Tschinkowitz tobias@he4d.net
Thu, 31 May 2018 13:53:49 +0200
commit

8c8091f4f165974c44d75dd9ccc7cc4dcd1d1c96

parent

b0401b13bb78bacde9d10b00766830cbeb2c90f6

1 files changed, 7 insertions(+), 0 deletions(-)

jump to
M components/wifi.ccomponents/wifi.c

@@ -109,6 +109,7 @@ load_ieee80211_nodereq(const char *iface, struct ieee80211_nodereq *nr)

{ 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));

@@ -119,6 +120,12 @@ }

strlcpy(bssid.i_name, iface, sizeof(bssid.i_name)); if ((ioctl(sockfd, SIOCG80211BSSID, &bssid)) < 0) { warn("ioctl 'SIOCG80211BSSID':"); + 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; }