From owner-p4-projects@FreeBSD.ORG Sat Oct 30 06:13:43 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EDE2416A4D0; Sat, 30 Oct 2004 06:13:42 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA25816A4CF for ; Sat, 30 Oct 2004 06:13:42 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91AED43D41 for ; Sat, 30 Oct 2004 06:13:42 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9U6DgGl029354 for ; Sat, 30 Oct 2004 06:13:42 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9U6Df3E029351 for perforce@freebsd.org; Sat, 30 Oct 2004 06:13:42 GMT (envelope-from sam@freebsd.org) Date: Sat, 30 Oct 2004 06:13:42 GMT Message-Id: <200410300613.i9U6Df3E029351@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 63968 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2004 06:13:43 -0000 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;