From 24a90e6b8118d01adcaf45ff615a9d247deaf80a Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Tue, 10 Feb 2009 01:37:55 +0000 Subject: [PATCH] correctly fixup iv_des_chan after installing a new channel table; if the previous channel is now invalid we must set it to IEEE80211_CHAN_ANYC --- sys/net80211/ieee80211_regdomain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_regdomain.c b/sys/net80211/ieee80211_regdomain.c index da3bfcc41341..91cf810d607f 100644 --- a/sys/net80211/ieee80211_regdomain.c +++ b/sys/net80211/ieee80211_regdomain.c @@ -428,8 +428,9 @@ ieee80211_setregdomain(struct ieee80211vap *vap, ieee80211_scan_flush(vap); ieee80211_dfs_reset(ic); if (vap->iv_des_chan != IEEE80211_CHAN_ANYC) { + c = ieee80211_find_channel(ic, desfreq, desflags); /* NB: may be NULL if not present in new channel list */ - vap->iv_des_chan = ieee80211_find_channel(ic, desfreq, desflags); + vap->iv_des_chan = (c != NULL) ? c : IEEE80211_CHAN_ANYC; } IEEE80211_UNLOCK(ic);