Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2005 01:14:13 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 69338 for review
Message-ID:  <200501200114.j0K1EDAX013401@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=69338

Change 69338 by sam@sam_ebb on 2005/01/20 01:13:59

	fix refcnt leak in adhoc mode: entries in the neighbor table
	created due to rx'd frames had an extra reference

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211_node.c#44 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#44 (text+ko) ====

@@ -1014,7 +1014,6 @@
 			ic->ic_newassoc(ic, ni, 1);
 		/* XXX not right for 802.1x/WPA */
 		ieee80211_node_authorize(ic, ni);
-		ieee80211_ref_node(ni);		/* hold reference */
 	}
 	return ni;
 }
@@ -1094,9 +1093,16 @@
 
 	if (ni == NULL) {
 		if (ic->ic_opmode == IEEE80211_M_IBSS ||
-		    ic->ic_opmode == IEEE80211_M_AHDEMO)
+		    ic->ic_opmode == IEEE80211_M_AHDEMO) {
+			/*
+			 * In adhoc mode cons up a node for the destination.
+			 * Note that we need an additional reference for the
+			 * caller to be consistent with _ieee80211_find_node.
+			 */
 			ni = ieee80211_fakeup_adhoc_node(nt, macaddr);
-		else {
+			if (ni != NULL)
+				(void) ieee80211_ref_node(ni);
+		} else {
 			IEEE80211_DPRINTF(ic, IEEE80211_MSG_OUTPUT,
 				"[%s] no node, discard frame (%s)\n",
 				ether_sprintf(macaddr), __func__);



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