From 513dcec6562948e9f2dc3348923833c8d659eaf2 Mon Sep 17 00:00:00 2001 From: Pawel Kulakowski Date: Fri, 21 Mar 2014 08:18:00 +0100 Subject: [PATCH] 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 --- src/ap/hostapd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 4ed718cf2..2ecaec82b 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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); }