hostapd: fix encrypted mesh channel settings
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 301-mesh-noscan.patch
1 Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/config.c
2 ===================================================================
3 --- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/config.c
4 +++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/config.c
5 @@ -2216,6 +2216,7 @@ static const struct parse_data ssid_fiel
6 #else /* CONFIG_MESH */
7 { INT_RANGE(mode, 0, 4) },
8 #endif /* CONFIG_MESH */
9 + { INT_RANGE(noscan, 0, 1) },
10 { INT_RANGE(proactive_key_caching, 0, 1) },
11 { INT_RANGE(disabled, 0, 2) },
12 { STR(id_str) },
13 Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_file.c
14 ===================================================================
15 --- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/config_file.c
16 +++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_file.c
17 @@ -816,6 +816,7 @@ static void wpa_config_write_network(FIL
18 #endif /* IEEE8021X_EAPOL */
19 INT(mode);
20 INT(no_auto_peer);
21 + INT(noscan);
22 INT(mesh_fwding);
23 INT(frequency);
24 INT(fixed_freq);
25 Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/mesh.c
26 ===================================================================
27 --- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/mesh.c
28 +++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/mesh.c
29 @@ -287,6 +287,8 @@ static int wpa_supplicant_mesh_init(stru
30 frequency);
31 goto out_free;
32 }
33 + if (ssid->noscan)
34 + conf->noscan = 1;
35 if (ssid->ht40)
36 conf->secondary_channel = ssid->ht40;
37 if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) {
38 Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/wpa_supplicant.c
39 ===================================================================
40 --- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/wpa_supplicant.c
41 +++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/wpa_supplicant.c
42 @@ -2024,12 +2024,12 @@ void ibss_mesh_setup_freq(struct wpa_sup
43 {
44 enum hostapd_hw_mode hw_mode;
45 struct hostapd_hw_modes *mode = NULL;
46 - int ht40plus[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
47 + int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
48 184, 192 };
49 int vht80[] = { 36, 52, 100, 116, 132, 149 };
50 struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
51 u8 channel;
52 - int i, chan_idx, ht40 = -1, res, obss_scan = 1;
53 + int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan);
54 unsigned int j, k;
55 struct hostapd_freq_params vht_freq;
56 int chwidth, seg0, seg1;
57 @@ -2099,7 +2099,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
58 return;
59
60 /* Setup higher BW only for 5 GHz */
61 - if (mode->mode != HOSTAPD_MODE_IEEE80211A)
62 + if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan))
63 return;
64
65 for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) {
66 Index: hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_ssid.h
67 ===================================================================
68 --- hostapd-2018-04-09-fa617ee6.orig/wpa_supplicant/config_ssid.h
69 +++ hostapd-2018-04-09-fa617ee6/wpa_supplicant/config_ssid.h
70 @@ -835,6 +835,8 @@ struct wpa_ssid {
71 */
72 int no_auto_peer;
73
74 + int noscan;
75 +
76 /**
77 * mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm)
78 *