diff options
author | sam <sam@FreeBSD.org> | 2005-01-18 19:59:40 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-01-18 19:59:40 +0000 |
commit | 4c9a185523b963e32b04d8114b4b3f1e582b7c6f (patch) | |
tree | e7f8473009184815a4872e6e036509552ab62b8e /sys | |
parent | 5d86ecca9fc1ae8d87d4f8078545386648502074 (diff) | |
download | FreeBSD-src-4c9a185523b963e32b04d8114b4b3f1e582b7c6f.zip FreeBSD-src-4c9a185523b963e32b04d8114b4b3f1e582b7c6f.tar.gz |
when scanning is interrupted reset state so table entries go in the station
table and not the scan table
Noticed by: Tai-hwa Liang
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211_node.c | 21 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.h | 1 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 4 |
3 files changed, 20 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index d16a687..e865c67 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -570,6 +570,20 @@ ieee80211_node_compare(struct ieee80211com *ic, } /* + * Mark an ongoing scan stopped. + */ +void +ieee80211_cancel_scan(struct ieee80211com *ic) +{ + + IEEE80211_DPRINTF(ic, IEEE80211_MSG_SCAN, "%s: end %s scan\n", + __func__, + (ic->ic_flags & IEEE80211_F_ASCAN) ? "active" : "passive"); + + ic->ic_flags &= ~(IEEE80211_F_SCAN | IEEE80211_F_ASCAN); +} + +/* * Complete a scan of potential channels. */ void @@ -578,15 +592,12 @@ ieee80211_end_scan(struct ieee80211com *ic) struct ieee80211_node *ni, *nextbs, *selbs; struct ieee80211_node_table *nt; - IEEE80211_DPRINTF(ic, IEEE80211_MSG_SCAN, "end %s scan\n", - (ic->ic_flags & IEEE80211_F_ASCAN) ? "active" : "passive"); + ieee80211_cancel_scan(ic); + ieee80211_notify_scan_done(ic); - ic->ic_flags &= ~(IEEE80211_F_SCAN | IEEE80211_F_ASCAN); nt = &ic->ic_scan; ni = TAILQ_FIRST(&nt->nt_node); - ieee80211_notify_scan_done(ic); - if (ic->ic_opmode == IEEE80211_M_HOSTAP) { u_int8_t maxrssi[IEEE80211_CHAN_MAX]; /* XXX off stack? */ int i, bestchan; diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 84bac07..20f9335 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -189,6 +189,7 @@ extern int ieee80211_next_scan(struct ieee80211com *); extern void ieee80211_create_ibss(struct ieee80211com*, struct ieee80211_channel *); extern void ieee80211_reset_bss(struct ieee80211com *); +extern void ieee80211_cancel_scan(struct ieee80211com *); extern void ieee80211_end_scan(struct ieee80211com *); extern int ieee80211_ibss_merge(struct ieee80211com *, struct ieee80211_node *); diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 74e865e..1d15726d 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -889,8 +889,10 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg break; } goto reset; - case IEEE80211_S_AUTH: case IEEE80211_S_SCAN: + ieee80211_cancel_scan(ic); + goto reset; + case IEEE80211_S_AUTH: reset: ic->ic_mgt_timer = 0; IF_DRAIN(&ic->ic_mgtq); |