return ni;
return ieee80211_ref_node(ni);
ieee80211_find_txnode(struct ieee80211com *ic, u_int8_t *macaddr){	struct ieee80211_node *ni;	ieee80211_node_critsec_decl(s);	/*	 * The destination address should be in the node table	 * unless we are operating in station mode or this is a	 * multicast/broadcast frame.	 */	if (ic->ic_opmode == IEEE80211_M_STA || IEEE80211_IS_MULTICAST(macaddr))		return ic->ic_bss;	/* XXX can't hold lock across dup_bss 'cuz of recursive locking */	ieee80211_node_critsec_begin(ic, s);	ni = _ieee80211_find_node(ic, macaddr);	ieee80211_node_critsec_end(ic, s);	if (ni == NULL &&	    (ic->ic_opmode == IEEE80211_M_IBSS ||	     ic->ic_opmode == IEEE80211_M_AHDEMO)) {		/*		 * Fake up a node; this handles node discovery in		 * adhoc mode.  Note that for the driver's benefit		 * we we treat this like an association so the driver		 * has an opportunity to setup it's private state.		 *		 * XXX need better way to handle this; issue probe		 *     request so we can deduce rate set, etc.		 */		ni = ieee80211_dup_bss(ic, macaddr);		if (ni != NULL) {			/* XXX no rate negotiation; just dup */			ni->ni_rates = ic->ic_bss->ni_rates;			if (ic->ic_newassoc)				(*ic->ic_newassoc)(ic, ni, 1);		}	}	return ni;}