summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_node.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-02-10 16:59:04 +0000
committersam <sam@FreeBSD.org>2005-02-10 16:59:04 +0000
commit9b44db51a104b1b3b4ea144b022138e0c109d97d (patch)
tree9f16885c47b00409d5f9b9a661f9f3c90c32c5c3 /sys/net80211/ieee80211_node.c
parent42eef8eb6f91be49ffb90c29302a0c3430a043c7 (diff)
downloadFreeBSD-src-9b44db51a104b1b3b4ea144b022138e0c109d97d.zip
FreeBSD-src-9b44db51a104b1b3b4ea144b022138e0c109d97d.tar.gz
propagate state kept in the bss node when re-creating the node
on state transitions; this is a stopgap measure, need to rethink how we do management of this state Identified by: Divy Le Ray
Diffstat (limited to 'sys/net80211/ieee80211_node.c')
-rw-r--r--sys/net80211/ieee80211_node.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 9407cd2..3c9ddab 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -347,6 +347,17 @@ ieee80211_next_scan(struct ieee80211com *ic)
return 0;
}
+static __inline void
+copy_bss(struct ieee80211_node *nbss, const struct ieee80211_node *obss)
+{
+ /* propagate useful state */
+ nbss->ni_authmode = obss->ni_authmode;
+ nbss->ni_txpower = obss->ni_txpower;
+ nbss->ni_vlan = obss->ni_vlan;
+ nbss->ni_rsn = obss->ni_rsn;
+ /* XXX statistics? */
+}
+
void
ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan)
{
@@ -381,6 +392,7 @@ ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan)
IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_myaddr);
ni->ni_esslen = ic->ic_des_esslen;
memcpy(ni->ni_essid, ic->ic_des_essid, ni->ni_esslen);
+ copy_bss(ni, ic->ic_bss);
ni->ni_intval = ic->ic_lintval;
if (ic->ic_flags & IEEE80211_F_PRIVACY)
ni->ni_capinfo |= IEEE80211_CAPINFO_PRIVACY;
@@ -428,8 +440,11 @@ ieee80211_reset_bss(struct ieee80211com *ic)
KASSERT(ni != NULL, ("unable to setup inital BSS node"));
obss = ic->ic_bss;
ic->ic_bss = ieee80211_ref_node(ni);
- if (obss != NULL)
+ if (obss != NULL) {
+ copy_bss(ni, obss);
+ ni->ni_intval = ic->ic_lintval;
ieee80211_free_node(obss);
+ }
}
static int
OpenPOWER on IntegriCloud