hostapd: fix frequency selection for ap+sta
[openwrt.git] / package / network / services / hostapd / patches / 340-reload_freq_change.patch
1 --- a/src/ap/hostapd.c
2 +++ b/src/ap/hostapd.c
3 @@ -72,6 +72,16 @@ static void hostapd_reload_bss(struct ho
4  #endif /* CONFIG_NO_RADIUS */
5  
6         ssid = &hapd->conf->ssid;
7 +
8 +       hostapd_set_freq(hapd, hapd->iconf->hw_mode, hapd->iface->freq,
9 +                        hapd->iconf->channel,
10 +                        hapd->iconf->ieee80211n,
11 +                        hapd->iconf->ieee80211ac,
12 +                        hapd->iconf->secondary_channel,
13 +                        hapd->iconf->vht_oper_chwidth,
14 +                        hapd->iconf->vht_oper_centr_freq_seg0_idx,
15 +                        hapd->iconf->vht_oper_centr_freq_seg1_idx);
16 +
17         if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
18             ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
19                 /*
20 @@ -172,6 +182,9 @@ int hostapd_reload_config(struct hostapd
21         oldconf = hapd->iconf;
22         iface->conf = newconf;
23  
24 +       if (iface->conf->channel)
25 +               iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel);
26 +
27         for (j = 0; j < iface->num_bss; j++) {
28                 hapd = iface->bss[j];
29                 hapd->iconf = newconf;