Purge the cached nodes when we switch back to SCAN. In case we lost
authorpatrick <patrick@openbsd.org>
Thu, 19 Aug 2021 14:13:39 +0000 (14:13 +0000)
committerpatrick <patrick@openbsd.org>
Thu, 19 Aug 2021 14:13:39 +0000 (14:13 +0000)
the connection because an AP is gone away, this makes sure we don't
end up picking a now non-existant AP over and over.

Another problem this works around is that when trying to re-join that
AP, the attempt to connect would not yield any event message from the
firmware, and then we would get stuck.  Since we now definitely choose
a different AP, this issue does not show up.

ok stsp@

sys/dev/ic/bwfm.c

index cb10a12..0c52220 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwfm.c,v 1.87 2021/08/19 13:58:40 patrick Exp $ */
+/* $OpenBSD: bwfm.c,v 1.88 2021/08/19 14:13:39 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
  * Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se>
@@ -2785,7 +2785,7 @@ bwfm_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
                        return 0;
                }
                ieee80211_set_link_state(ic, LINK_STATE_DOWN);
-               ieee80211_node_cleanup(ic, ic->ic_bss);
+               ieee80211_free_allnodes(ic, 1);
                ic->ic_state = nstate;
                splx(s);
                return 0;