PERFORCE change 66796 for review
Sam Leffler
sam at FreeBSD.org
Fri Dec 10 16:26:02 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=66796
Change 66796 by sam at sam_ebb on 2004/12/11 00:25:52
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
also:
o emit identical debug msg for station join in ap mode as
printed for station associate in sta mode (i.e. show slot
time, preamble, QoS, etc).
Affected files ...
.. //depot/projects/wifi/sys/net80211/ieee80211_input.c#29 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_node.c#27 edit
Differences ...
==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#29 (text+ko) ====
@@ -878,7 +878,6 @@
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 @@
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",
==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#27 (text+ko) ====
@@ -198,6 +198,7 @@
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
@@ -907,7 +908,8 @@
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);
@@ -1407,7 +1409,8 @@
* 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));
@@ -1602,14 +1605,20 @@
newassoc = 0;
IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG,
- "[%s] station %s associated at aid %d\n",
- ether_sprintf(ni->ni_macaddr), newassoc ? "newly" : "already",
- IEEE80211_NODE_AID(ni));
+ "[%s] station %sassociated at aid %d: %s preamble, %s slot time%s%s\n",
+ ether_sprintf(ni->ni_macaddr), newassoc ? "" : "re",
+ IEEE80211_NODE_AID(ni),
+ ic->ic_flags & IEEE80211_F_SHPREAMBLE ? "short" : "long",
+ ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long",
+ ic->ic_flags & IEEE80211_F_USEPROT ? ", protection" : "",
+ ni->ni_flags & IEEE80211_NODE_QOS ? ", QoS" : ""
+ );
/* give driver a chance to setup state like ni_txrate */
if (ic->ic_newassoc)
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)
More information about the p4-projects
mailing list