Date: Sat, 30 Oct 2004 06:13:42 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 63968 for review Message-ID: <200410300613.i9U6Df3E029351@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=63968 Change 63968 by sam@sam_ebb on 2004/10/30 06:13:10 o check if a node is authorized before sending a deauth frame due to an inactivy timeout; this is now needed because nodes created due to probe requests are now held o while here improve some comments and include the node refcnt on nodes being timed out Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_node.c#4 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#4 (text+ko) ==== @@ -935,20 +935,30 @@ } if (--ni->ni_inact <= 0) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_NODE, - "[%s] station timed out due to inactivity\n", - ether_sprintf(ni->ni_macaddr)); + "[%s] station timed out due to inactivity " + "(refcnt %u)\n", ether_sprintf(ni->ni_macaddr), + ieee80211_node_refcnt(ni)); /* - * Send a deauthenticate frame. + * Send a deauthenticate frame and drop the station. + * This is somewhat complicated due to reference counts + * and locking. At this point a station will typically + * have a reference count of 1. ieee80211_node_leave + * will do a "free" of the node which will drop the + * reference count. But in the meantime a reference + * wil be held by the deauth frame. The actual reclaim + * of the node will happen either after the tx is + * completed or by ieee80211_node_leave. * - * Drop the node lock before sending the - * deauthentication frame in case the driver takes - * a lock, as this will result in a LOR between the - * node lock and the driver lock. + * Separately we must drop the node lock before sending + * in case the driver takes a lock, as this will result + * in LOR between the node lock and the driver lock. */ IEEE80211_NODE_UNLOCK(ic); - IEEE80211_SEND_MGMT(ic, ni, - IEEE80211_FC0_SUBTYPE_DEAUTH, - IEEE80211_REASON_AUTH_EXPIRE); + if (ieee80211_node_is_authorized(ni)) { + IEEE80211_SEND_MGMT(ic, ni, + IEEE80211_FC0_SUBTYPE_DEAUTH, + IEEE80211_REASON_AUTH_EXPIRE); + } ieee80211_node_leave(ic, ni); ic->ic_stats.is_node_timeout++; goto restart;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410300613.i9U6Df3E029351>