From owner-p4-projects@FreeBSD.ORG Tue Dec 7 03:17:45 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 60B7D16A4D0; Tue, 7 Dec 2004 03:17:45 +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 3D4A616A4CE for ; Tue, 7 Dec 2004 03:17:45 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D3F043D6B for ; Tue, 7 Dec 2004 03:17:45 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iB73HjJ9033058 for ; Tue, 7 Dec 2004 03:17:45 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iB73Hilr033055 for perforce@freebsd.org; Tue, 7 Dec 2004 03:17:44 GMT (envelope-from sam@freebsd.org) Date: Tue, 7 Dec 2004 03:17:44 GMT Message-Id: <200412070317.iB73Hilr033055@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 66606 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: Tue, 07 Dec 2004 03:17:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=66606 Change 66606 by sam@sam_ebb on 2004/12/07 03:16:53 Go back to holding a reference on a station when we start authentication rather than when we receive a probe request. The race condition that motivated the original decision won't happen 'cuz of the node table changes and populating the station table based on probe requests is bad in a dense environment. Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_input.c#25 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#25 (text+ko) ==== @@ -873,7 +873,8 @@ ni = ieee80211_dup_bss(ic->ic_sta, wh->i_addr2); if (ni == NULL) 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); @@ -1023,8 +1024,10 @@ return; } allocbs = 1; - } else + } else { + (void) ieee80211_ref_node(ni); allocbs = 0; + } ni->ni_rssi = rssi; ni->ni_rstamp = rstamp; if (!alloc_challenge(ic, ni)) { @@ -2011,12 +2014,14 @@ wh, ieee80211_mgt_subtype_name[subtype >> IEEE80211_FC0_SUBTYPE_SHIFT], "%s", "recv'd rate set invalid"); - if (allocbs) /* reclaim immediately */ - ieee80211_free_node(ni); } else { IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_PROBE_RESP, 0); } + if (allocbs && ic->ic_opmode != IEEE80211_M_IBSS) { + /* reclaim immediately */ + ieee80211_free_node(ni); + } break; }