1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

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
This commit is contained in:
Sam Leffler 2004-12-31 22:05:13 +00:00
parent 5e923d2ebd
commit 2045f69945
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=139528
2 changed files with 7 additions and 5 deletions

View File

@ -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",

View File

@ -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)