diff mbox

[RFC,1/6] mesh: Enable DFS on mesh hostapd interface

Message ID 20161128153843.3179-2-benjamin@sipsolutions.net
State RFC
Headers show

Commit Message

Benjamin Berg Nov. 28, 2016, 3:38 p.m. UTC
Enable 80211h and 80211d if a DFS channel was selected and the country has
been configured. This is similar to wpa_supplicant AP mode.

Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
---
 wpa_supplicant/mesh.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index d67d3b2..70069bf 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -210,6 +210,13 @@  static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
 		goto out_free;
 	ifmsh->mconf = mconf;
 
+	if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) {
+		conf->ieee80211h = 1;
+		conf->ieee80211d = 1;
+		conf->country[0] = wpa_s->conf->country[0];
+		conf->country[1] = wpa_s->conf->country[1];
+	}
+
 	/* need conf->hw_mode for supported rates. */
 	conf->hw_mode = ieee80211_freq_to_chan(ssid->frequency, &conf->channel);
 	if (conf->hw_mode == NUM_HOSTAPD_MODES) {