o change ieee80211_dup_bss to inherit explicit data from ic_bss instead of

blindy copying the node contents; this turns out to be a bad idea as we
  add more state in the node for things like WPA
o track node allocation failures in ieee80211_dup_bss instead of the callers

Obtained from:	madwifi
This commit is contained in:
Sam Leffler 2004-04-02 23:09:24 +00:00
parent c64bfa0f8f
commit 694dca643b

View file

@ -480,9 +480,14 @@ ieee80211_dup_bss(struct ieee80211com *ic, u_int8_t *macaddr)
{
struct ieee80211_node *ni = (*ic->ic_node_alloc)(ic);
if (ni != NULL) {
memcpy(ni, ic->ic_bss, sizeof(struct ieee80211_node));
ieee80211_setup_node(ic, ni, macaddr);
}
/*
* Inherit from ic_bss.
*/
IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_bss->ni_bssid);
ni->ni_chan = ic->ic_bss->ni_chan;
} else
ic->ic_stats.is_rx_nodealloc++;
return ni;
}