Don't overwrite channel on hostapd config reload

There was possibility that the current channel in Beacon information
element was incorrectly set. This problem was easily observed when
primary and secondary channel were switched and then some of hostapd
settings (for example password) were changed using WPS External
Registrar. This caused hostapd_reload_config() function overwrite the
current channel information from config file.

This patch prevents this situation and does not allow to overwrite
channel and some other settings when config is reloaded.

Signed-off-by: Pawel Kulakowski <pawel.kulakowski@tieto.com>
This commit is contained in:
Pawel Kulakowski 2014-03-21 08:18:00 +01:00 committed by Jouni Malinen
parent 5eae87a7d6
commit 513dcec656

View file

@ -171,6 +171,16 @@ int hostapd_reload_config(struct hostapd_iface *iface)
for (j = 0; j < iface->num_bss; j++) { for (j = 0; j < iface->num_bss; j++) {
hapd = iface->bss[j]; hapd = iface->bss[j];
hapd->iconf = newconf; hapd->iconf = newconf;
hapd->iconf->channel = oldconf->channel;
hapd->iconf->ieee80211n = oldconf->ieee80211n;
hapd->iconf->ieee80211ac = oldconf->ieee80211ac;
hapd->iconf->ht_capab = oldconf->ht_capab;
hapd->iconf->vht_capab = oldconf->vht_capab;
hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth;
hapd->iconf->vht_oper_centr_freq_seg0_idx =
oldconf->vht_oper_centr_freq_seg0_idx;
hapd->iconf->vht_oper_centr_freq_seg1_idx =
oldconf->vht_oper_centr_freq_seg1_idx;
hapd->conf = newconf->bss[j]; hapd->conf = newconf->bss[j];
hostapd_reload_bss(hapd); hostapd_reload_bss(hapd);
} }