]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Don't overwrite channel on hostapd config reload
authorPawel Kulakowski <pawel.kulakowski@tieto.com>
Fri, 21 Mar 2014 07:18:00 +0000 (08:18 +0100)
committerJouni Malinen <j@w1.fi>
Fri, 21 Mar 2014 21:30:57 +0000 (23:30 +0200)
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>
src/ap/hostapd.c

index 4ed718cf2cb9182cf41195b83c573c4827180e79..2ecaec82b09dcd771828fe69ef34e7fc19df5c7c 100644 (file)
@@ -171,6 +171,16 @@ int hostapd_reload_config(struct hostapd_iface *iface)
        for (j = 0; j < iface->num_bss; j++) {
                hapd = iface->bss[j];
                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];
                hostapd_reload_bss(hapd);
        }