From 694dca643b6a4cef1685d5b905a44b4fd9d9fa85 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 2 Apr 2004 23:09:24 +0000 Subject: [PATCH] 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 --- sys/net80211/ieee80211_node.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 65fe2a3ebd8..59bac2616b6 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -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; }