summaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2018-07-16 12:34:15 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2018-07-16 12:34:15 +0000
commit8d149c777e7a723fc24fdbe40fe22f449a2f34a2 (patch)
treeca3cdbfeb8bb8ea4131c539457a17c60c4389742 /sys/net80211
parentda74c8540b016c3d297528654ca9081b4673add8 (diff)
don't save or use auto-join when the card is not in station (aka client) mode
OK stsp@
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_node.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index ba435d07567..48b861870d1 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.131 2018/07/13 07:22:55 phessler Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.132 2018/07/16 12:34:14 phessler Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -201,6 +201,10 @@ ieee80211_add_ess(struct ieee80211com *ic, char *nwid, int wpa, int wep)
struct ieee80211_ess *ess;
int i = 0, new = 0, ness = 0;
+ /* only valid for station (aka, client) mode */
+ if (ic->ic_opmode != IEEE80211_M_STA)
+ return (0);
+
/* Don't save an empty nwid */
if (strnlen(nwid, IEEE80211_NWID_LEN) == 0)
return (0);
@@ -1094,7 +1098,7 @@ ieee80211_end_scan(struct ifnet *ifp)
}
/* Possibly switch which ssid we are associated with */
- if (!bgscan)
+ if (!bgscan && ic->ic_opmode == IEEE80211_M_STA)
ieee80211_match_ess(ic);
for (; ni != NULL; ni = nextbs) {