summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-05-22 15:23:02 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-05-22 15:23:02 +0000
commita5ea0746ae2c9d66f291e357aa9f6b74e642dc46 (patch)
treef8625454b871291474b610e97b048d86485e0407 /sys/dev
parentcba05c10b1ef7e919e3fc2a2f1287fae42ea5566 (diff)
If we are SCANning and we want another SCAN, we don't need to purge
all nodes and set the link down, this already happened the first time we went to SCAN mode. This brings us in line with the net80211 stack and fixes an incomplete node list during ifconfig(8) scan.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/bwfm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c
index e0444f592fa..6b8abba7eb1 100644
--- a/sys/dev/ic/bwfm.c
+++ b/sys/dev/ic/bwfm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwfm.c,v 1.60 2019/04/25 01:52:13 kevlo Exp $ */
+/* $OpenBSD: bwfm.c,v 1.61 2019/05/22 15:23:01 patrick Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se>
@@ -2591,6 +2591,11 @@ bwfm_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
printf("%s: %s -> %s\n", DEVNAME(sc),
ieee80211_state_name[ic->ic_state],
ieee80211_state_name[nstate]);
+ /* No need to do this again. */
+ if (ic->ic_state == IEEE80211_S_SCAN) {
+ splx(s);
+ return 0;
+ }
ieee80211_set_link_state(ic, LINK_STATE_DOWN);
ieee80211_free_allnodes(ic, 1);
ic->ic_state = nstate;