summaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2016-08-15 22:16:47 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2016-08-15 22:16:47 +0000
commit9ade14d22b63e4564d99a51b53bb7a6eba657c28 (patch)
tree9a6db81c5cb5a99a392a255779619717cd95a6a8 /sbin/ifconfig
parent47c47355317e37d3cc38f9ee58901219925093ee (diff)
When running 'ifconfig scan' in hostap mode display the current Tx rate our
AP is using to send frames to an associated node. This used to always display the node's highest supported Rx rate, which isn't all that interesting. ok mpi@
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifconfig.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 40d8bf9d98b..e638f82403f 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.325 2016/08/03 20:45:36 vgross Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.326 2016/08/15 22:16:46 stsp Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -2341,8 +2341,19 @@ ieee80211_printnode(struct ieee80211_nodereq *nr)
if (nr->nr_pwrsave)
printf("powersave ");
- /* Only print the fastest rate */
- if (nr->nr_max_rxrate) {
+ /*
+ * Print our current Tx rate for associated nodes.
+ * Print the fastest supported rate for APs.
+ */
+ if ((nr->nr_flags & (IEEE80211_NODEREQ_AP)) == 0) {
+ if (nr->nr_flags & IEEE80211_NODEREQ_HT) {
+ printf("HT-MCS%d ", nr->nr_txmcs);
+ } else if (nr->nr_rates) {
+ printf("%uM ",
+ (nr->nr_rates[nr->nr_txrate] & IEEE80211_RATE_VAL)
+ / 2);
+ }
+ } else if (nr->nr_max_rxrate) {
printf("%uM HT ", nr->nr_max_rxrate);
} else if (nr->nr_rxmcs[0] != 0) {
for (i = IEEE80211_HT_NUM_MCS - 1; i >= 0; i--) {
@@ -2351,9 +2362,8 @@ ieee80211_printnode(struct ieee80211_nodereq *nr)
}
printf("HT-MCS%d ", i);
} else if (nr->nr_nrates) {
- printf("%uM",
+ printf("%uM ",
(nr->nr_rates[nr->nr_nrates - 1] & IEEE80211_RATE_VAL) / 2);
- putchar(' ');
}
/* ESS is the default, skip it */
nr->nr_capinfo &= ~IEEE80211_CAPINFO_ESS;