if (ni == NULL) { if (ic->ic_opmode != IEEE80211_M_HOSTAP) { if ((ni = ieee80211_dup_bss(ic, wh->i_addr2)) != NULL) IEEE80211_ADDR_COPY(ni->ni_bssid, (bssid != NULL) ? bssid : zero);
if (ni != NULL) return ieee80211_ref_node(ni); if (ic->ic_opmode == IEEE80211_M_HOSTAP) return ieee80211_ref_node(ic->ic_bss);
ieee80211_find_rxnode(struct ieee80211com *ic, struct ieee80211_frame *wh){	struct ieee80211_node *ni;	const static u_int8_t zero[IEEE80211_ADDR_LEN];	u_int8_t *bssid;	ieee80211_node_critsec_decl(s);	if (!ieee80211_needs_rxnode(ic, wh, &bssid))	        return ieee80211_ref_node(ic->ic_bss);	ieee80211_node_critsec_begin(ic, s);	ni = _ieee80211_find_node(ic, wh->i_addr2);	ieee80211_node_critsec_end(ic, s);	if (ni == NULL) {		if (ic->ic_opmode != IEEE80211_M_HOSTAP) {			if ((ni = ieee80211_dup_bss(ic, wh->i_addr2)) != NULL)				IEEE80211_ADDR_COPY(ni->ni_bssid,				    (bssid != NULL) ? bssid : zero);			/* XXX see remarks in ieee80211_find_txnode */			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);			}			IEEE80211_DPRINTF(("%s: faked-up node %p for %s\n",			    __func__, ni, ether_sprintf(wh->i_addr2)));		}		ni = ieee80211_ref_node((ni == NULL) ? ic->ic_bss : ni);	}	IASSERT(ni != NULL, ("%s: null node", __func__));	return ni;}