diff options
author | sam <sam@FreeBSD.org> | 2004-12-31 22:05:13 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2004-12-31 22:05:13 +0000 |
commit | 141330c912f5118aee2d4e4a82e9e12239905e98 (patch) | |
tree | 58ca43610e4f9751e55534bbb8f6450a35696dff /sys/net80211 | |
parent | 7c448457f677fbc644b4e16f7169a190355e6786 (diff) | |
download | FreeBSD-src-141330c912f5118aee2d4e4a82e9e12239905e98.zip FreeBSD-src-141330c912f5118aee2d4e4a82e9e12239905e98.tar.gz |
fixup inactivity timers:
o ic_inact_auth is a bad name, it's the inactivity threshold
for being associated but not authorized; use it that way
o reset ni_inact when switching inactivity thresholds to
minimize the race against the timer (don't want to lock
for this stuff)
o change the inactivity probe threshold from a one-shot to
cover a range: when below this threshold but not expired
send a probe each inactivity interval; should probably
guard against the interval being turned way down as this
could cause us to spam the net with probes
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_input.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index ede8175..33678fc 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -878,7 +878,6 @@ ieee80211_auth_open(struct ieee80211com *ic, struct ieee80211_frame *wh, return; } else (void) ieee80211_ref_node(ni); - ni->ni_inact_reload = ic->ic_inact_auth; IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1); IEEE80211_DPRINTF(ic, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, @@ -1070,7 +1069,6 @@ ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh, estatus = IEEE80211_STATUS_CHALLENGE; goto bad; } - ni->ni_inact_reload = ic->ic_inact_auth; IEEE80211_DPRINTF(ic, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, "[%s] station authenticated (shared key)\n", diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index c9cbc8b..68e1c7e 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -198,6 +198,7 @@ void ieee80211_node_authorize(struct ieee80211com *ic, struct ieee80211_node *ni) { ni->ni_flags |= IEEE80211_NODE_AUTH; + ni->ni_inact_reload = ic->ic_inact_run; } void @@ -911,7 +912,8 @@ ieee80211_setup_node(struct ieee80211_node_table *nt, ni->ni_authmode = IEEE80211_AUTH_OPEN; ni->ni_txpower = ic->ic_txpowlimit; /* max power */ ieee80211_crypto_resetkey(ic, &ni->ni_ucastkey, IEEE80211_KEYIX_NONE); - ni->ni_inact = ni->ni_inact_reload = nt->nt_inact_init; + ni->ni_inact_reload = nt->nt_inact_init; + ni->ni_inact = ni->ni_inact_reload; IEEE80211_NODE_SAVEQ_INIT(ni, "unknown"); IEEE80211_NODE_LOCK(nt); @@ -1411,7 +1413,8 @@ IEEE80211_DPRINTF(ic, IEEE80211_MSG_POWER, "[%s] discard frame, age %u\n", ether * universally supported by drivers (need it * for ps-poll support so it should be...). */ - if (ni->ni_inact == ic->ic_inact_probe) { + if (0 < ni->ni_inact && + ni->ni_inact <= ic->ic_inact_probe) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_NODE, "[%s] probe station due to inactivity\n", ether_sprintf(ni->ni_macaddr)); @@ -1619,7 +1622,8 @@ ieee80211_node_join(struct ieee80211com *ic, struct ieee80211_node *ni, int resp /* give driver a chance to setup state like ni_txrate */ if (ic->ic_newassoc != NULL) ic->ic_newassoc(ic, ni, newassoc); - ni->ni_inact_reload = ic->ic_inact_run; + ni->ni_inact_reload = ic->ic_inact_auth; + ni->ni_inact = ni->ni_inact_reload; IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_SUCCESS); /* tell the authenticator about new station */ if (ic->ic_auth->ia_node_join != NULL) |