summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2017-12-12 13:58:19 +0000
committerstsp <stsp@openbsd.org>2017-12-12 13:58:19 +0000
commit49a206bde5df359bedba72463ee921a954120ece (patch)
treea7c371a41f83d7ab2ecc4c10f349fbefc9dd09ee
parentAllow interfaces that aren't SCANNALLBAND drivers to benefit from the (diff)
downloadwireguard-openbsd-49a206bde5df359bedba72463ee921a954120ece.tar.xz
wireguard-openbsd-49a206bde5df359bedba72463ee921a954120ece.zip
Don't dereference IEEE80211_CHAN_ANYC pointer in ieee80211_node_checkrssi().
Problem reported by Gregoire Jadi on bugs@
-rw-r--r--sys/net80211/ieee80211_node.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 57641fac24a..4951e37790a 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.124 2017/12/12 13:38:10 phessler Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.125 2017/12/12 13:58:19 stsp Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -995,6 +995,9 @@ ieee80211_node_checkrssi(struct ieee80211com *ic,
{
uint8_t thres;
+ if (ni->ni_chan == IEEE80211_CHAN_ANYC)
+ return 0;
+
if (ic->ic_max_rssi) {
thres = (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) ?
IEEE80211_RSSI_THRES_RATIO_2GHZ :