hostapd: backport mesh/ibss HT20/HT40 related fix

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2016-07-26 13:47:00 +02:00
parent 86c0a569f4
commit da328f2865
6 changed files with 69 additions and 8 deletions

View file

@ -0,0 +1,61 @@
From: Masashi Honma <masashi.honma@gmail.com>
Date: Tue, 26 Jul 2016 11:45:40 +0900
Subject: [PATCH] mesh: Set correct secondary channel offset if HT40 is
disabled
Previously, secondary channel offset could be non zero even though
disable_ht40=1. This patch fixes it.
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
---
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1901,20 +1901,27 @@ void ibss_mesh_setup_freq(struct wpa_sup
break;
}
}
+#ifdef CONFIG_HT_OVERRIDES
+ if (ssid->disable_ht40)
+ ht40 = 0;
+#endif /* CONFIG_HT_OVERRIDES */
- /* Find secondary channel */
- for (i = 0; i < mode->num_channels; i++) {
- sec_chan = &mode->channels[i];
- if (sec_chan->chan == channel + ht40 * 4)
- break;
- sec_chan = NULL;
- }
- if (!sec_chan)
- return;
+ if (ht40) {
+ /* Find secondary channel */
+ for (i = 0; i < mode->num_channels; i++) {
+ sec_chan = &mode->channels[i];
+ if (sec_chan->chan == channel + ht40 * 4)
+ break;
+ sec_chan = NULL;
+ }
+ if (!sec_chan)
+ return;
- /* Check secondary channel flags */
- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
- return;
+ /* Check secondary channel flags */
+ if (sec_chan->flag &
+ (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
+ return;
+ }
freq->channel = pri_chan->chan;
@@ -1930,6 +1937,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
freq->sec_channel_offset = 1;
break;
default:
+ freq->sec_channel_offset = 0;
break;
}

View file

@ -258,7 +258,7 @@
struct wpa_supplicant *wpa_s; struct wpa_supplicant *wpa_s;
--- a/wpa_supplicant/wpa_supplicant.c --- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c
@@ -4982,7 +4982,6 @@ struct wpa_interface * wpa_supplicant_ma @@ -4990,7 +4990,6 @@ struct wpa_interface * wpa_supplicant_ma
return NULL; return NULL;
} }
@ -266,7 +266,7 @@
/** /**
* wpa_supplicant_match_existing - Match existing interfaces * wpa_supplicant_match_existing - Match existing interfaces
* @global: Pointer to global data from wpa_supplicant_init() * @global: Pointer to global data from wpa_supplicant_init()
@@ -5019,6 +5018,11 @@ static int wpa_supplicant_match_existing @@ -5027,6 +5026,11 @@ static int wpa_supplicant_match_existing
#endif /* CONFIG_MATCH_IFACE */ #endif /* CONFIG_MATCH_IFACE */
@ -278,7 +278,7 @@
/** /**
* wpa_supplicant_add_iface - Add a new network interface * wpa_supplicant_add_iface - Add a new network interface
@@ -5274,6 +5278,8 @@ struct wpa_global * wpa_supplicant_init( @@ -5282,6 +5286,8 @@ struct wpa_global * wpa_supplicant_init(
#ifndef CONFIG_NO_WPA_MSG #ifndef CONFIG_NO_WPA_MSG
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
#endif /* CONFIG_NO_WPA_MSG */ #endif /* CONFIG_NO_WPA_MSG */

View file

@ -1,6 +1,6 @@
--- a/wpa_supplicant/wpa_supplicant.c --- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c
@@ -3548,7 +3548,7 @@ wpa_supplicant_alloc(struct wpa_supplica @@ -3556,7 +3556,7 @@ wpa_supplicant_alloc(struct wpa_supplica
if (wpa_s == NULL) if (wpa_s == NULL)
return NULL; return NULL;
wpa_s->scan_req = INITIAL_SCAN_REQ; wpa_s->scan_req = INITIAL_SCAN_REQ;

View file

@ -114,7 +114,7 @@
wpa_s->new_connection = 1; wpa_s->new_connection = 1;
wpa_drv_set_operstate(wpa_s, 0); wpa_drv_set_operstate(wpa_s, 0);
#ifndef IEEE8021X_EAPOL #ifndef IEEE8021X_EAPOL
@@ -4638,6 +4691,20 @@ static int wpa_supplicant_init_iface(str @@ -4646,6 +4699,20 @@ static int wpa_supplicant_init_iface(str
sizeof(wpa_s->bridge_ifname)); sizeof(wpa_s->bridge_ifname));
} }
@ -135,7 +135,7 @@
/* RSNA Supplicant Key Management - INITIALIZE */ /* RSNA Supplicant Key Management - INITIALIZE */
eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
eapol_sm_notify_portValid(wpa_s->eapol, FALSE); eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
@@ -4929,6 +4996,11 @@ static void wpa_supplicant_deinit_iface( @@ -4937,6 +5004,11 @@ static void wpa_supplicant_deinit_iface(
if (terminate) if (terminate)
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);

View file

@ -175,7 +175,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
* macsec_policy - Determines the policy for MACsec secure session * macsec_policy - Determines the policy for MACsec secure session
--- a/wpa_supplicant/wpa_supplicant.c --- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c
@@ -2510,6 +2510,13 @@ static void wpas_start_assoc_cb(struct w @@ -2518,6 +2518,13 @@ static void wpas_start_assoc_cb(struct w
params.beacon_int = ssid->beacon_int; params.beacon_int = ssid->beacon_int;
else else
params.beacon_int = wpa_s->conf->beacon_int; params.beacon_int = wpa_s->conf->beacon_int;

View file

@ -145,7 +145,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
/** /**
--- a/wpa_supplicant/wpa_supplicant.c --- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c
@@ -2517,6 +2517,8 @@ static void wpas_start_assoc_cb(struct w @@ -2525,6 +2525,8 @@ static void wpas_start_assoc_cb(struct w
i++; i++;
} }
params.mcast_rate = ssid->mcast_rate; params.mcast_rate = ssid->mcast_rate;