[v3,09/12] wpa_supplicant: SME: correct use of multi_ap_backhaul_sta

Message ID 20181205102401.17810-10-arnout@mind.be
State New
Headers show
  • [v3,01/12] hostapd: Add Multi-AP protocol support
Related show

Commit Message

Arnout Vandecappelle Dec. 5, 2018, 10:23 a.m.
In the SME case when there are multiple SSIDs configured, we should use
the multi_ap_backhaul_sta setting of the current SSID, not arbitrarily
the first one.

Also, in general (e.g. when performing WPS) there may be no configured
SSID at all.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Venkateswara Naralasetty <vnaralas@codeaurora.org>
I'm not 100% sure about this patch. But I tested it (with a single SSID)
and it still works. And it looks obvious to me that using the first
configured SSID makes no sense.
 wpa_supplicant/sme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 947095820..570aadfcf 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -1547,7 +1547,7 @@  void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
 #endif /* CONFIG_OWE */
-	if (wpa_s->conf->ssid->multi_ap_backhaul_sta) {
+	if (wpa_s->current_ssid && wpa_s->current_ssid->multi_ap_backhaul_sta) {
 		size_t multi_ap_ie_len = add_multi_ap_ie(
 			wpa_s->sme.assoc_req_ie + wpa_s->sme.assoc_req_ie_len,
 			sizeof(wpa_s->sme.assoc_req_ie) - wpa_s->sme.assoc_req_ie_len,