From 4f16860a0f12c87749c2085c6c759ed94e80e071 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Sat, 28 Apr 2018 14:49:08 +0000 Subject: When starting a background scan, free the nodes table to ensure we get an up-to-date view of APs around us. In particular, we need to kick out the AP we are associated to. Otherwise, our current AP might stay cached if it is turned off while we are scanning, and we could end up picking a now non-existent but "good looking" AP over and over. found with and ok phessler@ --- sys/dev/ic/pgt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/ic') diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c index 8ff77a99ccb..0fbe8f8f129 100644 --- a/sys/dev/ic/pgt.c +++ b/sys/dev/ic/pgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pgt.c,v 1.91 2018/04/28 11:17:08 pirofti Exp $ */ +/* $OpenBSD: pgt.c,v 1.92 2018/04/28 14:49:07 stsp Exp $ */ /* * Copyright (c) 2006 Claudio Jeker @@ -2936,7 +2936,7 @@ pgt_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) ic->ic_if.if_timer = 0; ic->ic_mgt_timer = 0; ic->ic_flags &= ~IEEE80211_F_SIBSS; - ieee80211_free_allnodes(ic); + ieee80211_free_allnodes(ic, 1); break; case IEEE80211_S_SCAN: ic->ic_if.if_timer = 1; @@ -2944,7 +2944,7 @@ pgt_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) if (sc->sc_flags & SC_NOFREE_ALLNODES) sc->sc_flags &= ~SC_NOFREE_ALLNODES; else - ieee80211_free_allnodes(ic); + ieee80211_free_allnodes(ic, 1); #ifndef IEEE80211_STA_ONLY /* Just use any old channel; we override it anyway. */ -- cgit v1.2.3