summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2020-04-17 07:09:05 +0000
committerstsp <stsp@openbsd.org>2020-04-17 07:09:05 +0000
commit88300dedee1d696a0d92dee0000a074b6e64496c (patch)
tree5b0429f4ae0aecce65a33467d460c2d574d14279
parentOnly pay attention to interfaces in our routing domain (diff)
downloadwireguard-openbsd-88300dedee1d696a0d92dee0000a074b6e64496c.tar.xz
wireguard-openbsd-88300dedee1d696a0d92dee0000a074b6e64496c.zip
Prevent MiRA from jumping from very high to very low rates while
switching ratesets when probing. Fixes iwm(4) switching from MCS 15 down to MCS 0, rather than switching to a comparable rate in the next rateset, such as MCS 7. This wasn't supposed to happen but did because of a MiRA implementation bug. ok jmatthew@
-rw-r--r--sys/net80211/ieee80211_mira.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_mira.c b/sys/net80211/ieee80211_mira.c
index 29df16879e0..23bfcf0a331 100644
--- a/sys/net80211/ieee80211_mira.c
+++ b/sys/net80211/ieee80211_mira.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_mira.c,v 1.28 2020/04/11 13:47:53 stsp Exp $ */
+/* $OpenBSD: ieee80211_mira.c,v 1.29 2020/04/17 07:09:05 stsp Exp $ */
/*
* Copyright (c) 2016 Stefan Sperling <stsp@openbsd.org>
@@ -670,6 +670,9 @@ ieee80211_mira_probe_next_rateset(struct ieee80211_mira_node *mn,
break;
}
}
+ /* If all rates are lower the maximum rate is the closest match. */
+ if (i == rsnext->nrates)
+ ni->ni_txmcs = rsnext->max_mcs;
/* Add rates from the next rateset as candidates. */
mn->candidate_rates |= (1 << ni->ni_txmcs);