Patchwork wpa_supplicant : ssid associate ?

login
register
mail settings
Submitter sylvain_gmail
Date Jan. 9, 2013, 8:55 p.m.
Message ID <50EDD94E.1010004@gmail.com>
Download mbox | patch
Permalink /patch/210872/
State Rejected
Headers show

Comments

sylvain_gmail - Jan. 9, 2013, 8:55 p.m.
Hello,

there is some think that i don't understand in 
wpa_supplicant/wpa_supplicant.c file
     void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
                               struct wpa_bss *bss, struct wpa_ssid 
*ssid) function

Why we fixed ssid in struct wpa_driver_associate_params  with struct 
wpa_bss *bss or struct wpa_ssid *ssid.
Why we coun't allway fixed ssid with wpa_ssid *ssid as in my patch?

best regards,
Sylvain
Jouni Malinen - Jan. 9, 2013, 11:17 p.m.
On Wed, Jan 09, 2013 at 09:55:42PM +0100, sylvain_gmail wrote:
> Why we fixed ssid in struct wpa_driver_associate_params  with struct
> wpa_bss *bss or struct wpa_ssid *ssid.
> Why we coun't allway fixed ssid with wpa_ssid *ssid as in my patch?

wpa_supplicant supports network configuration blocks that use wildcard
SSID, i.e., ssid->ssid may be NULL in which case the SSID has to be
copied from the BSS entry (scan result).

Patch

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 0fb4d0f..01ddb1b 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1537,9 +1537,9 @@  void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
 	}
 
 	wpa_supplicant_set_state(wpa_s, WPA_ASSOCIATING);
+	params.ssid = ssid->ssid;
+	params.ssid_len = ssid->ssid_len;
 	if (bss) {
-		params.ssid = bss->ssid;
-		params.ssid_len = bss->ssid_len;
 		if (!wpas_driver_bss_selection(wpa_s) || ssid->bssid_set) {
 			wpa_printf(MSG_DEBUG, "Limit connection to BSSID "
 				   MACSTR " freq=%u MHz based on scan results "
@@ -1549,9 +1549,6 @@  void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
 			params.bssid = bss->bssid;
 			params.freq = bss->freq;
 		}
-	} else {
-		params.ssid = ssid->ssid;
-		params.ssid_len = ssid->ssid_len;
 	}
 
 	if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set &&