From 3d073929951f8076031fe109de4ee553c3505af6 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 31 Dec 2004 21:22:12 +0000 Subject: [PATCH] check if the node/station table is already present before creating one; this can happen on an ibss merge --- sys/net80211/ieee80211_node.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index c6a8500bebb7..02553ec0e4c5 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -758,17 +758,20 @@ ieee80211_sta_join(struct ieee80211com *ic, struct ieee80211_node *selbs) return 0; } /* - * Create the neighbor table. + * Create the neighbor table; it will already + * exist if we are simply switching mastership. */ - ic->ic_sta = ieee80211_node_table_alloc(ic, + if (ic->ic_sta == NULL) { + ic->ic_sta = ieee80211_node_table_alloc(ic, "neighbor", ic->ic_inact_run, ieee80211_timeout_stations); - if (ic->ic_sta == NULL) { - /* - * Should remain in SCAN state and retry. - */ - /* XXX stat+msg */ - return 0; + if (ic->ic_sta == NULL) { + /* + * Should remain in SCAN state and retry. + */ + /* XXX stat+msg */ + return 0; + } } }