aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/interworking.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-11-06 22:17:48 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-06 22:17:48 (GMT)
commit08b267797405c23158cb5db3d5e9f46cb24b0ec3 (patch)
treee446648ba32072b5e059d60715dfade0a15e0720 /wpa_supplicant/interworking.c
parentb4264f8f678088c864b00e4da5db0be3027a37f3 (diff)
downloadhostap-08b267797405c23158cb5db3d5e9f46cb24b0ec3.zip
hostap-08b267797405c23158cb5db3d5e9f46cb24b0ec3.tar.gz
hostap-08b267797405c23158cb5db3d5e9f46cb24b0ec3.tar.bz2
Interworking: Use SSID from the BSS entry
There is no need to parse the IE buffer again to find the SSID of the BSS since that information is already stored in struct wpa_bss. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/interworking.c')
-rw-r--r--wpa_supplicant/interworking.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index 6f50c97..93652d8 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -825,7 +825,6 @@ static int interworking_connect_3gpp(struct wpa_supplicant *wpa_s,
{
#ifdef INTERWORKING_3GPP
struct wpa_ssid *ssid;
- const u8 *ie;
int eap_type;
int res;
char prefix;
@@ -833,9 +832,6 @@ static int interworking_connect_3gpp(struct wpa_supplicant *wpa_s,
if (bss->anqp == NULL || bss->anqp->anqp_3gpp == NULL)
return -1;
- ie = wpa_bss_get_ie(bss, WLAN_EID_SSID);
- if (ie == NULL)
- return -1;
wpa_printf(MSG_DEBUG, "Interworking: Connect with " MACSTR " (3GPP)",
MAC2STR(bss->bssid));
@@ -856,11 +852,11 @@ static int interworking_connect_3gpp(struct wpa_supplicant *wpa_s,
wpa_config_set_network_defaults(ssid);
ssid->priority = cred->priority;
ssid->temporary = 1;
- ssid->ssid = os_zalloc(ie[1] + 1);
+ ssid->ssid = os_zalloc(bss->ssid_len + 1);
if (ssid->ssid == NULL)
goto fail;
- os_memcpy(ssid->ssid, ie + 2, ie[1]);
- ssid->ssid_len = ie[1];
+ os_memcpy(ssid->ssid, bss->ssid, bss->ssid_len);
+ ssid->ssid_len = bss->ssid_len;
if (interworking_set_hs20_params(wpa_s, ssid) < 0)
goto fail;
@@ -1199,7 +1195,7 @@ static int interworking_set_eap_params(struct wpa_ssid *ssid,
static int interworking_connect_roaming_consortium(
struct wpa_supplicant *wpa_s, struct wpa_cred *cred,
- struct wpa_bss *bss, const u8 *ssid_ie)
+ struct wpa_bss *bss)
{
struct wpa_ssid *ssid;
@@ -1222,11 +1218,11 @@ static int interworking_connect_roaming_consortium(
wpa_config_set_network_defaults(ssid);
ssid->priority = cred->priority;
ssid->temporary = 1;
- ssid->ssid = os_zalloc(ssid_ie[1] + 1);
+ ssid->ssid = os_zalloc(bss->ssid_len + 1);
if (ssid->ssid == NULL)
goto fail;
- os_memcpy(ssid->ssid, ssid_ie + 2, ssid_ie[1]);
- ssid->ssid_len = ssid_ie[1];
+ os_memcpy(ssid->ssid, bss->ssid, bss->ssid_len);
+ ssid->ssid_len = bss->ssid_len;
if (interworking_set_hs20_params(wpa_s, ssid) < 0)
goto fail;
@@ -1263,7 +1259,6 @@ int interworking_connect(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
struct nai_realm_eap *eap = NULL;
u16 count, i;
char buf[100];
- const u8 *ie;
if (wpa_s->conf->cred == NULL || bss == NULL)
return -1;
@@ -1273,12 +1268,6 @@ int interworking_connect(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
MACSTR, MAC2STR(bss->bssid));
return -1;
}
- ie = wpa_bss_get_ie(bss, WLAN_EID_SSID);
- if (ie == NULL || ie[1] == 0) {
- wpa_printf(MSG_DEBUG, "Interworking: No SSID known for "
- MACSTR, MAC2STR(bss->bssid));
- return -1;
- }
if (!wpa_bss_get_ie(bss, WLAN_EID_RSN)) {
/*
@@ -1315,7 +1304,7 @@ int interworking_connect(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
(cred == NULL || cred_rc->priority >= cred->priority) &&
(cred_3gpp == NULL || cred_rc->priority >= cred_3gpp->priority))
return interworking_connect_roaming_consortium(wpa_s, cred_rc,
- bss, ie);
+ bss);
if (cred_3gpp &&
(cred == NULL || cred_3gpp->priority >= cred->priority)) {
@@ -1374,11 +1363,11 @@ int interworking_connect(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
wpa_config_set_network_defaults(ssid);
ssid->priority = cred->priority;
ssid->temporary = 1;
- ssid->ssid = os_zalloc(ie[1] + 1);
+ ssid->ssid = os_zalloc(bss->ssid_len + 1);
if (ssid->ssid == NULL)
goto fail;
- os_memcpy(ssid->ssid, ie + 2, ie[1]);
- ssid->ssid_len = ie[1];
+ os_memcpy(ssid->ssid, bss->ssid, bss->ssid_len);
+ ssid->ssid_len = bss->ssid_len;
if (interworking_set_hs20_params(wpa_s, ssid) < 0)
goto fail;