[PATCH] Don't overwrite channel when hostAP is working.

Pawel Kulakowski pawel.kulakowski at tieto.com
Fri Mar 21 03:18:00 EDT 2014


There was possibility that 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 hostAP
settings (for example password) were changed using External Registrar.
This cause that hostapd_reload_config function overwrite channel
from config file.

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

Signed-off-by: Pawel Kulakowski <pawel.kulakowski at tieto.com>
---
 src/ap/hostapd.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 4ed718c..3b3da2e 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -171,6 +171,14 @@ 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);
 	}
-- 
1.7.9.5



More information about the HostAP mailing list