summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-08-13 22:09:44 +0000
committersam <sam@FreeBSD.org>2003-08-13 22:09:44 +0000
commitaf81e4b88b676946e3442bf7d4f9af2e40838249 (patch)
tree244a2909477eff2931f53f98709a2b718e02b520 /sys/net80211
parente588332388c1b9727f5a65662fb2e12046735134 (diff)
downloadFreeBSD-src-af81e4b88b676946e3442bf7d4f9af2e40838249.zip
FreeBSD-src-af81e4b88b676946e3442bf7d4f9af2e40838249.tar.gz
Delay creating ic_bss until after the super-class has a chance
to override the method pointers for manipulating nodes; this fixes a problem where the ic_bss node was not being created properly for the ath driver causing the driver to scribble on random memory. Noticed by: David Young <dyoung@pobox.com>
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211.c6
-rw-r--r--sys/net80211/ieee80211_node.c7
-rw-r--r--sys/net80211/ieee80211_node.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index ad585ba..2c38913 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -252,6 +252,12 @@ ieee80211_media_init(struct ifnet *ifp,
struct ieee80211_rateset allrates;
/*
+ * Do late attach work that must wait for any subclass
+ * (i.e. driver) work such as overriding methods.
+ */
+ ieee80211_node_lateattach(ifp);
+
+ /*
* Fill in media characteristics.
*/
ifmedia_init(&ic->ic_media, 0, media_change, media_stat);
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index a05c838..dd2541e 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -86,6 +86,13 @@ ieee80211_node_attach(struct ifnet *ifp)
ic->ic_node_alloc = ieee80211_node_alloc;
ic->ic_node_free = ieee80211_node_free;
ic->ic_node_copy = ieee80211_node_copy;
+}
+
+void
+ieee80211_node_lateattach(struct ifnet *ifp)
+{
+ struct ieee80211com *ic = (void *)ifp;
+
ic->ic_bss = (*ic->ic_node_alloc)(ic);
KASSERT(ic->ic_bss != NULL, ("unable to setup inital BSS node"));
ic->ic_bss->ni_chan = IEEE80211_CHAN_ANYC;
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h
index 49993b9..d4d62de 100644
--- a/sys/net80211/ieee80211_node.h
+++ b/sys/net80211/ieee80211_node.h
@@ -121,6 +121,7 @@ ieee80211_unref_node(struct ieee80211_node **ni)
struct ieee80211com;
extern void ieee80211_node_attach(struct ifnet *);
+extern void ieee80211_node_lateattach(struct ifnet *);
extern void ieee80211_node_detach(struct ifnet *);
extern void ieee80211_begin_scan(struct ifnet *);
OpenPOWER on IntegriCloud