Patchwork Fix adding extra ies in sched scan

login
register
mail settings
Submitter Eyal Shapira
Date Aug. 12, 2012, 5:18 p.m.
Message ID <1344791888-22939-1-git-send-email-eyal@wizery.com>
Download mbox | patch
Permalink /patch/176788/
State Accepted
Commit a13e07ec4dbb91bacbd224bf3ccc67542b807889
Headers show

Comments

Eyal Shapira - Aug. 12, 2012, 5:18 p.m.
Refactoring done in commit
(46ee04 IEEE 802.11u: Allow Interworking and HESSID to be configured)
broke adding extra ies in sched scan. The ies stopped being added
to the scan params within wpa_supplicant_extra_ies but no code
was added to add them in wpa_supplicant_req_sched_scan.
Fix it and remove unused params arg in wpa_supplicant_extra_ies.

Signed-hostap: Eyal Shapira <eyal@wizery.com>
---
 wpa_supplicant/scan.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
Jouni Malinen - Aug. 13, 2012, 6:51 p.m.
On Sun, Aug 12, 2012 at 08:18:08PM +0300, Eyal Shapira wrote:
> Refactoring done in commit
> (46ee04 IEEE 802.11u: Allow Interworking and HESSID to be configured)
> broke adding extra ies in sched scan. The ies stopped being added
> to the scan params within wpa_supplicant_extra_ies but no code
> was added to add them in wpa_supplicant_req_sched_scan.
> Fix it and remove unused params arg in wpa_supplicant_extra_ies.

Thanks, applied.

Patch

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 10a4693..6c3f625 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -381,8 +381,7 @@  static void wpas_add_interworking_elements(struct wpa_supplicant *wpa_s,
 
 
 static struct wpabuf *
-wpa_supplicant_extra_ies(struct wpa_supplicant *wpa_s,
-			 struct wpa_driver_scan_params *params)
+wpa_supplicant_extra_ies(struct wpa_supplicant *wpa_s)
 {
 	struct wpabuf *extra_ie = NULL;
 #ifdef CONFIG_WPS
@@ -635,7 +634,7 @@  ssid_list_set:
 #endif /* CONFIG_P2P */
 
 	wpa_supplicant_optimize_freqs(wpa_s, &params);
-	extra_ie = wpa_supplicant_extra_ies(wpa_s, &params);
+	extra_ie = wpa_supplicant_extra_ies(wpa_s);
 
 #ifdef CONFIG_HS20
 	if (wpa_s->conf->hs20 && wpabuf_resize(&extra_ie, 6) == 0)
@@ -763,7 +762,7 @@  int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
 	struct wpa_driver_scan_params *scan_params;
 	enum wpa_states prev_state;
 	struct wpa_ssid *ssid = NULL;
-	struct wpabuf *wps_ie = NULL;
+	struct wpabuf *extra_ie = NULL;
 	int ret;
 	unsigned int max_sched_scan_ssids;
 	int wildcard = 0;
@@ -925,8 +924,11 @@  int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
 		params.filter_ssids = NULL;
 	}
 
-	if (wpa_s->wps)
-		wps_ie = wpa_supplicant_extra_ies(wpa_s, &params);
+	extra_ie = wpa_supplicant_extra_ies(wpa_s);
+	if (extra_ie) {
+		params.extra_ies = wpabuf_head(extra_ie);
+		params.extra_ies_len = wpabuf_len(extra_ie);
+	}
 
 	scan_params = &params;
 
@@ -943,8 +945,9 @@  scan:
 
 	ret = wpa_supplicant_start_sched_scan(wpa_s, scan_params,
 					      wpa_s->sched_scan_interval);
-	wpabuf_free(wps_ie);
+	wpabuf_free(extra_ie);
 	os_free(params.filter_ssids);
+
 	if (ret) {
 		wpa_msg(wpa_s, MSG_WARNING, "Failed to initiate sched scan");
 		if (prev_state != wpa_s->wpa_state)