summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2022-12-18 18:56:39 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2022-12-18 18:56:39 +0000
commitef7ebd5ffd4ad61fb076da828990008d62999d13 (patch)
tree626fa377aa0ad4bf5bff1f36fa534b7f9ea66978 /sbin
parent7aedd8c4560a9dd3d5f32b6805c287d5ad18a563 (diff)
Unify RSSI check
Two spots in ifconfig print the signal strength, one for the "ieee80211: " line and one for each SSID in scan output. Only the former checks nr_rssi, which is not needed as nr_max_rssi alone indicates whether the driver reports signal strength in percentage or dBm. Zap the nr_rssi check to simplify; "worst case" we display 0% or 0dBm instead of nothing. Feedback OK stsp
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 1f699324839..06753159e76 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.459 2022/11/26 07:26:43 jmc Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.460 2022/12/18 18:56:38 kn Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -2522,13 +2522,10 @@ ieee80211_status(void)
bcopy(bssid.i_bssid, &nr.nr_macaddr, sizeof(nr.nr_macaddr));
strlcpy(nr.nr_ifname, ifname, sizeof(nr.nr_ifname));
if (ioctl(sock, SIOCG80211NODE, &nr) == 0) {
- if (nr.nr_rssi) {
- if (nr.nr_max_rssi)
- printf(" %u%%",
- IEEE80211_NODEREQ_RSSI(&nr));
- else
- printf(" %ddBm", nr.nr_rssi);
- }
+ if (nr.nr_max_rssi)
+ printf(" %u%%", IEEE80211_NODEREQ_RSSI(&nr));
+ else
+ printf(" %ddBm", nr.nr_rssi);
assocfail = nr.nr_assoc_fail;
}
}