Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Aug 2005 17:55:47 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 81298 for review
Message-ID:  <200508011755.j71HtlnD012740@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/systm.h>
@@ -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 <sys/cdefs.h>
-__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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508011755.j71HtlnD012740>