From 1a4ae5c45bfcd0108bbd327c454c96ba66ea36b6 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Mon, 26 Nov 2007 21:28:18 +0000 Subject: [PATCH] Be more careful handling off-channel frames: if the driver (wrongly) sends frames up the stack after changing the current channel then the lookup by ieee channel number may fail leaving a null ptr in se_chan; if this happens fallback to the channel recorded when the frame is processed (curchan). Since the frame doesn't contribute to scan results for the sta this is acceptable. Reviewed by: thompsa MFC after: 3 days --- sys/net80211/ieee80211_scan_sta.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c index eb21259e7e2..7d7548c9f67 100644 --- a/sys/net80211/ieee80211_scan_sta.c +++ b/sys/net80211/ieee80211_scan_sta.c @@ -290,11 +290,12 @@ found: */ c = ieee80211_find_channel_byieee(ic, sp->bchan, sp->curchan->ic_flags); - if (c == NULL && ise->se_chan == NULL) { + if (c != NULL) { + ise->se_chan = c; + } else if (ise->se_chan == NULL) { /* should not happen, pick something */ - c = sp->curchan; + ise->se_chan = sp->curchan; } - ise->se_chan = c; } else ise->se_chan = sp->curchan; ise->se_fhdwell = sp->fhdwell;