1
0

340-reload_freq_change.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --- a/src/ap/hostapd.c
  2. +++ b/src/ap/hostapd.c
  3. @@ -80,6 +80,16 @@ static void hostapd_reload_bss(struct ho
  4. #endif /* CONFIG_NO_RADIUS */
  5. ssid = &hapd->conf->ssid;
  6. +
  7. + hostapd_set_freq(hapd, hapd->iconf->hw_mode, hapd->iface->freq,
  8. + hapd->iconf->channel,
  9. + hapd->iconf->ieee80211n,
  10. + hapd->iconf->ieee80211ac,
  11. + hapd->iconf->secondary_channel,
  12. + hapd->iconf->vht_oper_chwidth,
  13. + hapd->iconf->vht_oper_centr_freq_seg0_idx,
  14. + hapd->iconf->vht_oper_centr_freq_seg1_idx);
  15. +
  16. if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
  17. ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
  18. /*
  19. @@ -179,21 +189,12 @@ int hostapd_reload_config(struct hostapd
  20. oldconf = hapd->iconf;
  21. iface->conf = newconf;
  22. + if (iface->conf->channel)
  23. + iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel);
  24. +
  25. for (j = 0; j < iface->num_bss; j++) {
  26. hapd = iface->bss[j];
  27. hapd->iconf = newconf;
  28. - hapd->iconf->channel = oldconf->channel;
  29. - hapd->iconf->acs = oldconf->acs;
  30. - hapd->iconf->secondary_channel = oldconf->secondary_channel;
  31. - hapd->iconf->ieee80211n = oldconf->ieee80211n;
  32. - hapd->iconf->ieee80211ac = oldconf->ieee80211ac;
  33. - hapd->iconf->ht_capab = oldconf->ht_capab;
  34. - hapd->iconf->vht_capab = oldconf->vht_capab;
  35. - hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth;
  36. - hapd->iconf->vht_oper_centr_freq_seg0_idx =
  37. - oldconf->vht_oper_centr_freq_seg0_idx;
  38. - hapd->iconf->vht_oper_centr_freq_seg1_idx =
  39. - oldconf->vht_oper_centr_freq_seg1_idx;
  40. hapd->conf = newconf->bss[j];
  41. hostapd_reload_bss(hapd);
  42. }