From owner-p4-projects@FreeBSD.ORG Mon Aug 1 17:55:48 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 098EC16A421; Mon, 1 Aug 2005 17:55:48 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 D8AE916A41F for ; Mon, 1 Aug 2005 17:55:47 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A39A343D45 for ; Mon, 1 Aug 2005 17:55:47 +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 j71HtlAr012743 for ; Mon, 1 Aug 2005 17:55:47 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j71HtlnD012740 for perforce@freebsd.org; Mon, 1 Aug 2005 17:55:47 GMT (envelope-from sam@freebsd.org) Date: Mon, 1 Aug 2005 17:55:47 GMT Message-Id: <200508011755.j71HtlnD012740@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 Cc: Subject: PERFORCE change 81298 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2005 17:55:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=81298 Change 81298 by sam@sam_ebb on 2005/08/01 17:54:49 IFC send_nulldata refcnt fix Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_input.c#58 edit .. //depot/projects/wifi/sys/net80211/ieee80211_output.c#50 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#58 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.76 2005/07/27 04:41:25 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.77 2005/07/31 06:12:32 sam Exp $"); #include #include @@ -2803,7 +2803,7 @@ IEEE80211_DPRINTF(ic, IEEE80211_MSG_POWER, "[%s] recv ps-poll, but queue empty\n", ether_sprintf(wh->i_addr2)); - ieee80211_send_nulldata(ni); + ieee80211_send_nulldata(ieee80211_ref_node(ni)); ic->ic_stats.is_ps_qempty++; /* XXX node stat */ if (ic->ic_set_tim != NULL) ic->ic_set_tim(ni, 0); /* just in case */ ==== //depot/projects/wifi/sys/net80211/ieee80211_output.c#50 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.31 2005/07/22 21:11:26 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.32 2005/07/31 06:12:32 sam Exp $"); #include "opt_inet.h" @@ -213,6 +213,10 @@ /* * Send a null data frame to the specified node. + * + * NB: the caller is assumed to have setup a node reference + * for use; this is necessary to deal with a race condition + * when probing for inactive stations. */ int ieee80211_send_nulldata(struct ieee80211_node *ni) @@ -226,9 +230,10 @@ if (m == NULL) { /* XXX debug msg */ ic->ic_stats.is_tx_nobuf++; + ieee80211_unref_node(&ni); return ENOMEM; } - m->m_pkthdr.rcvif = (void *) ieee80211_ref_node(ni); + m->m_pkthdr.rcvif = (void *) ni; wh = mtod(m, struct ieee80211_frame *); ieee80211_send_setup(ic, ni, wh,