From c0ad98bb7c5c5cb8129f69f62b57d9b1b76d5314 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 29 Jun 2003 20:13:38 +0000 Subject: insure ic_bss always has a "valid" channel; avoids problems where users could query the state of a card and find a null channel since allocating the node left ni_chan zero --- sys/net80211/ieee80211_node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/net80211') diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index d799f2b..9176ea7 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -87,7 +87,8 @@ ieee80211_node_attach(struct ifnet *ifp) ic->ic_node_free = ieee80211_node_free; ic->ic_node_copy = ieee80211_node_copy; ic->ic_bss = (*ic->ic_node_alloc)(ic); - /* XXX KASSERT != NULL? */ + KASSERT(ic->ic_bss != NULL, ("unable to setup inital BSS node")); + ic->ic_bss->ni_chan = IEEE80211_CHAN_ANYC; } void -- cgit v1.1