Interworking: Convert wpa_printf() to wpa_msg()

Also adds a few messages that helped me track down why things
were not working as expected.

Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
Ben Greear 2014-03-05 16:19:51 -08:00 committed by Jouni Malinen
parent b42f539ed2
commit 99805a0ea1

View file

@ -250,8 +250,8 @@ static int interworking_anqp_send_req(struct wpa_supplicant *wpa_s,
struct wpabuf *extra = NULL; struct wpabuf *extra = NULL;
int all = wpa_s->fetch_all_anqp; int all = wpa_s->fetch_all_anqp;
wpa_printf(MSG_DEBUG, "Interworking: ANQP Query Request to " MACSTR, wpa_msg(wpa_s, MSG_DEBUG, "Interworking: ANQP Query Request to " MACSTR,
MAC2STR(bss->bssid)); MAC2STR(bss->bssid));
wpa_s->interworking_gas_bss = bss; wpa_s->interworking_gas_bss = bss;
info_ids[num_info_ids++] = ANQP_CAPABILITY_LIST; info_ids[num_info_ids++] = ANQP_CAPABILITY_LIST;
@ -312,14 +312,14 @@ static int interworking_anqp_send_req(struct wpa_supplicant *wpa_s,
res = gas_query_req(wpa_s->gas, bss->bssid, bss->freq, buf, res = gas_query_req(wpa_s->gas, bss->bssid, bss->freq, buf,
interworking_anqp_resp_cb, wpa_s); interworking_anqp_resp_cb, wpa_s);
if (res < 0) { if (res < 0) {
wpa_printf(MSG_DEBUG, "ANQP: Failed to send Query Request"); wpa_msg(wpa_s, MSG_DEBUG, "ANQP: Failed to send Query Request");
wpabuf_free(buf); wpabuf_free(buf);
ret = -1; ret = -1;
eloop_register_timeout(0, 0, interworking_continue_anqp, wpa_s, eloop_register_timeout(0, 0, interworking_continue_anqp, wpa_s,
NULL); NULL);
} else } else
wpa_printf(MSG_DEBUG, "ANQP: Query started with dialog token " wpa_msg(wpa_s, MSG_DEBUG,
"%u", res); "ANQP: Query started with dialog token %u", res);
return ret; return ret;
} }
@ -966,8 +966,8 @@ static int interworking_connect_3gpp(struct wpa_supplicant *wpa_s,
if (bss->anqp == NULL || bss->anqp->anqp_3gpp == NULL) if (bss->anqp == NULL || bss->anqp->anqp_3gpp == NULL)
return -1; return -1;
wpa_printf(MSG_DEBUG, "Interworking: Connect with " MACSTR " (3GPP)", wpa_msg(wpa_s, MSG_DEBUG, "Interworking: Connect with " MACSTR
MAC2STR(bss->bssid)); " (3GPP)", MAC2STR(bss->bssid));
if (already_connected(wpa_s, cred, bss)) { if (already_connected(wpa_s, cred, bss)) {
wpa_msg(wpa_s, MSG_INFO, INTERWORKING_ALREADY_CONNECTED MACSTR, wpa_msg(wpa_s, MSG_INFO, INTERWORKING_ALREADY_CONNECTED MACSTR,
@ -1024,13 +1024,13 @@ static int interworking_connect_3gpp(struct wpa_supplicant *wpa_s,
break; break;
} }
if (res < 0) { if (res < 0) {
wpa_printf(MSG_DEBUG, "Selected EAP method (%d) not supported", wpa_msg(wpa_s, MSG_DEBUG,
eap_type); "Selected EAP method (%d) not supported", eap_type);
goto fail; goto fail;
} }
if (!cred->pcsc && set_root_nai(ssid, cred->imsi, prefix) < 0) { if (!cred->pcsc && set_root_nai(ssid, cred->imsi, prefix) < 0) {
wpa_printf(MSG_DEBUG, "Failed to set Root NAI"); wpa_msg(wpa_s, MSG_DEBUG, "Failed to set Root NAI");
goto fail; goto fail;
} }
@ -1503,8 +1503,8 @@ static int interworking_connect_roaming_consortium(
{ {
struct wpa_ssid *ssid; struct wpa_ssid *ssid;
wpa_printf(MSG_DEBUG, "Interworking: Connect with " MACSTR " based on " wpa_msg(wpa_s, MSG_DEBUG, "Interworking: Connect with " MACSTR
"roaming consortium match", MAC2STR(bss->bssid)); " based on roaming consortium match", MAC2STR(bss->bssid));
if (already_connected(wpa_s, cred, bss)) { if (already_connected(wpa_s, cred, bss)) {
wpa_msg(wpa_s, MSG_INFO, INTERWORKING_ALREADY_CONNECTED MACSTR, wpa_msg(wpa_s, MSG_INFO, INTERWORKING_ALREADY_CONNECTED MACSTR,
@ -1532,8 +1532,8 @@ static int interworking_connect_roaming_consortium(
goto fail; goto fail;
if (cred->eap_method == NULL) { if (cred->eap_method == NULL) {
wpa_printf(MSG_DEBUG, "Interworking: No EAP method set for " wpa_msg(wpa_s, MSG_DEBUG,
"credential using roaming consortium"); "Interworking: No EAP method set for credential using roaming consortium");
goto fail; goto fail;
} }
@ -1572,8 +1572,9 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s,
return -1; return -1;
if (disallowed_bssid(wpa_s, bss->bssid) || if (disallowed_bssid(wpa_s, bss->bssid) ||
disallowed_ssid(wpa_s, bss->ssid, bss->ssid_len)) { disallowed_ssid(wpa_s, bss->ssid, bss->ssid_len)) {
wpa_printf(MSG_DEBUG, "Interworking: Reject connection to disallowed BSS " wpa_msg(wpa_s, MSG_DEBUG,
MACSTR, MAC2STR(bss->bssid)); "Interworking: Reject connection to disallowed BSS "
MACSTR, MAC2STR(bss->bssid));
return -1; return -1;
} }
@ -1586,27 +1587,26 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s,
* We currently support only HS 2.0 networks and those are * We currently support only HS 2.0 networks and those are
* required to use WPA2-Enterprise. * required to use WPA2-Enterprise.
*/ */
wpa_printf(MSG_DEBUG, "Interworking: Network does not use " wpa_msg(wpa_s, MSG_DEBUG,
"RSN"); "Interworking: Network does not use RSN");
return -1; return -1;
} }
cred_rc = interworking_credentials_available_roaming_consortium( cred_rc = interworking_credentials_available_roaming_consortium(
wpa_s, bss, 0, excl); wpa_s, bss, 0, excl);
if (cred_rc) { if (cred_rc) {
wpa_printf(MSG_DEBUG, "Interworking: Highest roaming " wpa_msg(wpa_s, MSG_DEBUG,
"consortium matching credential priority %d " "Interworking: Highest roaming consortium matching credential priority %d sp_priority %d",
"sp_priority %d", cred_rc->priority, cred_rc->sp_priority);
cred_rc->priority, cred_rc->sp_priority);
if (allow_excluded && excl && !(*excl)) if (allow_excluded && excl && !(*excl))
excl = NULL; excl = NULL;
} }
cred = interworking_credentials_available_realm(wpa_s, bss, 0, excl); cred = interworking_credentials_available_realm(wpa_s, bss, 0, excl);
if (cred) { if (cred) {
wpa_printf(MSG_DEBUG, "Interworking: Highest NAI Realm list " wpa_msg(wpa_s, MSG_DEBUG,
"matching credential priority %d sp_priority %d", "Interworking: Highest NAI Realm list matching credential priority %d sp_priority %d",
cred->priority, cred->sp_priority); cred->priority, cred->sp_priority);
if (allow_excluded && excl && !(*excl)) if (allow_excluded && excl && !(*excl))
excl = NULL; excl = NULL;
} }
@ -1614,22 +1614,22 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s,
cred_3gpp = interworking_credentials_available_3gpp(wpa_s, bss, 0, cred_3gpp = interworking_credentials_available_3gpp(wpa_s, bss, 0,
excl); excl);
if (cred_3gpp) { if (cred_3gpp) {
wpa_printf(MSG_DEBUG, "Interworking: Highest 3GPP matching " wpa_msg(wpa_s, MSG_DEBUG,
"credential priority %d sp_priority %d", "Interworking: Highest 3GPP matching credential priority %d sp_priority %d",
cred_3gpp->priority, cred_3gpp->sp_priority); cred_3gpp->priority, cred_3gpp->sp_priority);
if (allow_excluded && excl && !(*excl)) if (allow_excluded && excl && !(*excl))
excl = NULL; excl = NULL;
} }
if (!cred_rc && !cred && !cred_3gpp) { if (!cred_rc && !cred && !cred_3gpp) {
wpa_printf(MSG_DEBUG, "Interworking: No full credential matches - consider options without BW(etc.) limits"); wpa_msg(wpa_s, MSG_DEBUG,
"Interworking: No full credential matches - consider options without BW(etc.) limits");
cred_rc = interworking_credentials_available_roaming_consortium( cred_rc = interworking_credentials_available_roaming_consortium(
wpa_s, bss, 1, excl); wpa_s, bss, 1, excl);
if (cred_rc) { if (cred_rc) {
wpa_printf(MSG_DEBUG, "Interworking: Highest roaming " wpa_msg(wpa_s, MSG_DEBUG,
"consortium matching credential priority %d " "Interworking: Highest roaming consortium matching credential priority %d sp_priority %d (ignore BW)",
"sp_priority %d (ignore BW)", cred_rc->priority, cred_rc->sp_priority);
cred_rc->priority, cred_rc->sp_priority);
if (allow_excluded && excl && !(*excl)) if (allow_excluded && excl && !(*excl))
excl = NULL; excl = NULL;
} }
@ -1637,10 +1637,9 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s,
cred = interworking_credentials_available_realm(wpa_s, bss, 1, cred = interworking_credentials_available_realm(wpa_s, bss, 1,
excl); excl);
if (cred) { if (cred) {
wpa_printf(MSG_DEBUG, "Interworking: Highest NAI Realm " wpa_msg(wpa_s, MSG_DEBUG,
"list matching credential priority %d " "Interworking: Highest NAI Realm list matching credential priority %d sp_priority %d (ignore BW)",
"sp_priority %d (ignore BW)", cred->priority, cred->sp_priority);
cred->priority, cred->sp_priority);
if (allow_excluded && excl && !(*excl)) if (allow_excluded && excl && !(*excl))
excl = NULL; excl = NULL;
} }
@ -1648,10 +1647,9 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s,
cred_3gpp = interworking_credentials_available_3gpp(wpa_s, bss, cred_3gpp = interworking_credentials_available_3gpp(wpa_s, bss,
1, excl); 1, excl);
if (cred_3gpp) { if (cred_3gpp) {
wpa_printf(MSG_DEBUG, "Interworking: Highest 3GPP " wpa_msg(wpa_s, MSG_DEBUG,
"matching credential priority %d " "Interworking: Highest 3GPP matching credential priority %d sp_priority %d (ignore BW)",
"sp_priority %d (ignore BW)", cred_3gpp->priority, cred_3gpp->sp_priority);
cred_3gpp->priority, cred_3gpp->sp_priority);
if (allow_excluded && excl && !(*excl)) if (allow_excluded && excl && !(*excl))
excl = NULL; excl = NULL;
} }
@ -1669,16 +1667,18 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s,
} }
if (cred == NULL) { if (cred == NULL) {
wpa_printf(MSG_DEBUG, "Interworking: No matching credentials " wpa_msg(wpa_s, MSG_DEBUG,
"found for " MACSTR, MAC2STR(bss->bssid)); "Interworking: No matching credentials found for "
MACSTR, MAC2STR(bss->bssid));
return -1; return -1;
} }
realm = nai_realm_parse(bss->anqp ? bss->anqp->nai_realm : NULL, realm = nai_realm_parse(bss->anqp ? bss->anqp->nai_realm : NULL,
&count); &count);
if (realm == NULL) { if (realm == NULL) {
wpa_printf(MSG_DEBUG, "Interworking: Could not parse NAI " wpa_msg(wpa_s, MSG_DEBUG,
"Realm list from " MACSTR, MAC2STR(bss->bssid)); "Interworking: Could not parse NAI Realm list from "
MACSTR, MAC2STR(bss->bssid));
return -1; return -1;
} }
@ -1691,15 +1691,15 @@ static int interworking_connect_helper(struct wpa_supplicant *wpa_s,
} }
if (!eap) { if (!eap) {
wpa_printf(MSG_DEBUG, "Interworking: No matching credentials " wpa_msg(wpa_s, MSG_DEBUG,
"and EAP method found for " MACSTR, "Interworking: No matching credentials and EAP method found for "
MAC2STR(bss->bssid)); MACSTR, MAC2STR(bss->bssid));
nai_realm_free(realm, count); nai_realm_free(realm, count);
return -1; return -1;
} }
wpa_printf(MSG_DEBUG, "Interworking: Connect with " MACSTR, wpa_msg(wpa_s, MSG_DEBUG, "Interworking: Connect with " MACSTR,
MAC2STR(bss->bssid)); MAC2STR(bss->bssid));
if (already_connected(wpa_s, cred, bss)) { if (already_connected(wpa_s, cred, bss)) {
wpa_msg(wpa_s, MSG_INFO, INTERWORKING_ALREADY_CONNECTED MACSTR, wpa_msg(wpa_s, MSG_INFO, INTERWORKING_ALREADY_CONNECTED MACSTR,
@ -1927,10 +1927,12 @@ static struct wpa_cred * interworking_credentials_available_3gpp(
#if defined(PCSC_FUNCS) || defined(CONFIG_EAP_PROXY) #if defined(PCSC_FUNCS) || defined(CONFIG_EAP_PROXY)
compare: compare:
#endif /* PCSC_FUNCS || CONFIG_EAP_PROXY */ #endif /* PCSC_FUNCS || CONFIG_EAP_PROXY */
wpa_printf(MSG_DEBUG, "Interworking: Parsing 3GPP info from " wpa_msg(wpa_s, MSG_DEBUG,
MACSTR, MAC2STR(bss->bssid)); "Interworking: Parsing 3GPP info from " MACSTR,
MAC2STR(bss->bssid));
ret = plmn_id_match(bss->anqp->anqp_3gpp, imsi, mnc_len); ret = plmn_id_match(bss->anqp->anqp_3gpp, imsi, mnc_len);
wpa_printf(MSG_DEBUG, "PLMN match %sfound", ret ? "" : "not "); wpa_msg(wpa_s, MSG_DEBUG, "PLMN match %sfound",
ret ? "" : "not ");
if (ret) { if (ret) {
if (cred_no_required_oi_match(cred, bss)) if (cred_no_required_oi_match(cred, bss))
continue; continue;
@ -1982,12 +1984,13 @@ static struct wpa_cred * interworking_credentials_available_realm(
if (wpa_s->conf->cred == NULL) if (wpa_s->conf->cred == NULL)
return NULL; return NULL;
wpa_printf(MSG_DEBUG, "Interworking: Parsing NAI Realm list from " wpa_msg(wpa_s, MSG_DEBUG, "Interworking: Parsing NAI Realm list from "
MACSTR, MAC2STR(bss->bssid)); MACSTR, MAC2STR(bss->bssid));
realm = nai_realm_parse(bss->anqp->nai_realm, &count); realm = nai_realm_parse(bss->anqp->nai_realm, &count);
if (realm == NULL) { if (realm == NULL) {
wpa_printf(MSG_DEBUG, "Interworking: Could not parse NAI " wpa_msg(wpa_s, MSG_DEBUG,
"Realm list from " MACSTR, MAC2STR(bss->bssid)); "Interworking: Could not parse NAI Realm list from "
MACSTR, MAC2STR(bss->bssid));
return NULL; return NULL;
} }
@ -2026,6 +2029,9 @@ static struct wpa_cred * interworking_credentials_available_realm(
} }
} }
break; break;
} else {
wpa_msg(wpa_s, MSG_DEBUG,
"Interworking: realm-find-eap returned false");
} }
} }
} }
@ -2166,8 +2172,9 @@ int interworking_home_sp_cred(struct wpa_supplicant *wpa_s,
realm = os_strchr(nai, '@'); realm = os_strchr(nai, '@');
if (realm) if (realm)
realm++; realm++;
wpa_printf(MSG_DEBUG, "Interworking: Search for match " wpa_msg(wpa_s, MSG_DEBUG,
"with SIM/USIM domain %s", realm); "Interworking: Search for match with SIM/USIM domain %s",
realm);
if (realm && if (realm &&
domain_name_list_contains(domain_names, realm, 1)) domain_name_list_contains(domain_names, realm, 1))
return 1; return 1;
@ -2180,8 +2187,9 @@ int interworking_home_sp_cred(struct wpa_supplicant *wpa_s,
return ret; return ret;
for (i = 0; i < cred->num_domain; i++) { for (i = 0; i < cred->num_domain; i++) {
wpa_printf(MSG_DEBUG, "Interworking: Search for match with " wpa_msg(wpa_s, MSG_DEBUG,
"home SP FQDN %s", cred->domain[i]); "Interworking: Search for match with home SP FQDN %s",
cred->domain[i]);
if (domain_name_list_contains(domain_names, cred->domain[i], 1)) if (domain_name_list_contains(domain_names, cred->domain[i], 1))
return 1; return 1;
} }
@ -2357,14 +2365,16 @@ static void interworking_select_network(struct wpa_supplicant *wpa_s)
&excluded); &excluded);
if (!cred) if (!cred)
continue; continue;
if (!wpa_bss_get_ie(bss, WLAN_EID_RSN)) { if (!wpa_bss_get_ie(bss, WLAN_EID_RSN)) {
/* /*
* We currently support only HS 2.0 networks and those * We currently support only HS 2.0 networks and those
* are required to use WPA2-Enterprise. * are required to use WPA2-Enterprise.
*/ */
wpa_printf(MSG_DEBUG, "Interworking: Credential match " wpa_msg(wpa_s, MSG_DEBUG,
"with " MACSTR " but network does not use " "Interworking: Credential match with " MACSTR
"RSN", MAC2STR(bss->bssid)); " but network does not use RSN",
MAC2STR(bss->bssid));
continue; continue;
} }
if (!excluded) if (!excluded)
@ -2455,8 +2465,8 @@ static void interworking_select_network(struct wpa_supplicant *wpa_s)
* have matching APs. * have matching APs.
*/ */
if (interworking_find_network_match(wpa_s)) { if (interworking_find_network_match(wpa_s)) {
wpa_printf(MSG_DEBUG, "Interworking: Possible BSS " wpa_msg(wpa_s, MSG_DEBUG,
"match for enabled network configurations"); "Interworking: Possible BSS match for enabled network configurations");
if (wpa_s->auto_select) { if (wpa_s->auto_select) {
interworking_reconnect(wpa_s); interworking_reconnect(wpa_s);
return; return;
@ -2464,8 +2474,8 @@ static void interworking_select_network(struct wpa_supplicant *wpa_s)
} }
if (wpa_s->auto_network_select) { if (wpa_s->auto_network_select) {
wpa_printf(MSG_DEBUG, "Interworking: Continue " wpa_msg(wpa_s, MSG_DEBUG,
"scanning after ANQP fetch"); "Interworking: Continue scanning after ANQP fetch");
wpa_supplicant_req_scan(wpa_s, wpa_s->scan_interval, wpa_supplicant_req_scan(wpa_s, wpa_s->scan_interval,
0); 0);
return; return;
@ -2516,9 +2526,10 @@ interworking_match_anqp_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
os_memcmp(bss->ssid, other->ssid, bss->ssid_len) != 0) os_memcmp(bss->ssid, other->ssid, bss->ssid_len) != 0)
continue; continue;
wpa_printf(MSG_DEBUG, "Interworking: Share ANQP data with " wpa_msg(wpa_s, MSG_DEBUG,
"already fetched BSSID " MACSTR " and " MACSTR, "Interworking: Share ANQP data with already fetched BSSID "
MAC2STR(other->bssid), MAC2STR(bss->bssid)); MACSTR " and " MACSTR,
MAC2STR(other->bssid), MAC2STR(bss->bssid));
other->anqp->users++; other->anqp->users++;
return other->anqp; return other->anqp;
} }
@ -2661,8 +2672,9 @@ int anqp_send_req(struct wpa_supplicant *wpa_s, const u8 *dst,
if (freq <= 0) if (freq <= 0)
return -1; return -1;
wpa_printf(MSG_DEBUG, "ANQP: Query Request to " MACSTR " for %u id(s)", wpa_msg(wpa_s, MSG_DEBUG,
MAC2STR(dst), (unsigned int) num_ids); "ANQP: Query Request to " MACSTR " for %u id(s)",
MAC2STR(dst), (unsigned int) num_ids);
#ifdef CONFIG_HS20 #ifdef CONFIG_HS20
if (subtypes != 0) { if (subtypes != 0) {
@ -2680,12 +2692,13 @@ int anqp_send_req(struct wpa_supplicant *wpa_s, const u8 *dst,
res = gas_query_req(wpa_s->gas, dst, freq, buf, anqp_resp_cb, wpa_s); res = gas_query_req(wpa_s->gas, dst, freq, buf, anqp_resp_cb, wpa_s);
if (res < 0) { if (res < 0) {
wpa_printf(MSG_DEBUG, "ANQP: Failed to send Query Request"); wpa_msg(wpa_s, MSG_DEBUG, "ANQP: Failed to send Query Request");
wpabuf_free(buf); wpabuf_free(buf);
ret = -1; ret = -1;
} else } else {
wpa_printf(MSG_DEBUG, "ANQP: Query started with dialog token " wpa_msg(wpa_s, MSG_DEBUG,
"%u", res); "ANQP: Query started with dialog token %u", res);
}
return ret; return ret;
} }
@ -2801,22 +2814,23 @@ static void interworking_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
pos, slen); pos, slen);
break; break;
default: default:
wpa_printf(MSG_DEBUG, "HS20: Unsupported ANQP " wpa_msg(wpa_s, MSG_DEBUG,
"vendor type %u", type); "HS20: Unsupported ANQP vendor type %u",
type);
break; break;
} }
break; break;
#endif /* CONFIG_HS20 */ #endif /* CONFIG_HS20 */
default: default:
wpa_printf(MSG_DEBUG, "Interworking: Unsupported " wpa_msg(wpa_s, MSG_DEBUG,
"vendor-specific ANQP OUI %06x", "Interworking: Unsupported vendor-specific ANQP OUI %06x",
WPA_GET_BE24(pos)); WPA_GET_BE24(pos));
return; return;
} }
break; break;
default: default:
wpa_printf(MSG_DEBUG, "Interworking: Unsupported ANQP Info ID " wpa_msg(wpa_s, MSG_DEBUG,
"%u", info_id); "Interworking: Unsupported ANQP Info ID %u", info_id);
break; break;
} }
} }
@ -2848,8 +2862,8 @@ void anqp_resp_cb(void *ctx, const u8 *dst, u8 dialog_token,
pos = wpabuf_head(adv_proto); pos = wpabuf_head(adv_proto);
if (wpabuf_len(adv_proto) < 4 || pos[0] != WLAN_EID_ADV_PROTO || if (wpabuf_len(adv_proto) < 4 || pos[0] != WLAN_EID_ADV_PROTO ||
pos[1] < 2 || pos[3] != ACCESS_NETWORK_QUERY_PROTOCOL) { pos[1] < 2 || pos[3] != ACCESS_NETWORK_QUERY_PROTOCOL) {
wpa_printf(MSG_DEBUG, "ANQP: Unexpected Advertisement " wpa_msg(wpa_s, MSG_DEBUG,
"Protocol in response"); "ANQP: Unexpected Advertisement Protocol in response");
if (wpa_s->fetch_osu_icon_in_progress) if (wpa_s->fetch_osu_icon_in_progress)
hs20_icon_fetch_failed(wpa_s); hs20_icon_fetch_failed(wpa_s);
anqp_result = "INVALID_FRAME"; anqp_result = "INVALID_FRAME";
@ -2878,7 +2892,7 @@ void anqp_resp_cb(void *ctx, const u8 *dst, u8 dialog_token,
unsigned int left = end - pos; unsigned int left = end - pos;
if (left < 4) { if (left < 4) {
wpa_printf(MSG_DEBUG, "ANQP: Invalid element"); wpa_msg(wpa_s, MSG_DEBUG, "ANQP: Invalid element");
anqp_result = "INVALID_FRAME"; anqp_result = "INVALID_FRAME";
goto out_parse_done; goto out_parse_done;
} }
@ -2888,8 +2902,9 @@ void anqp_resp_cb(void *ctx, const u8 *dst, u8 dialog_token,
pos += 2; pos += 2;
left -= 4; left -= 4;
if (left < slen) { if (left < slen) {
wpa_printf(MSG_DEBUG, "ANQP: Invalid element length " wpa_msg(wpa_s, MSG_DEBUG,
"for Info ID %u", info_id); "ANQP: Invalid element length for Info ID %u",
info_id);
anqp_result = "INVALID_FRAME"; anqp_result = "INVALID_FRAME";
goto out_parse_done; goto out_parse_done;
} }
@ -2909,8 +2924,8 @@ out:
static void interworking_scan_res_handler(struct wpa_supplicant *wpa_s, static void interworking_scan_res_handler(struct wpa_supplicant *wpa_s,
struct wpa_scan_results *scan_res) struct wpa_scan_results *scan_res)
{ {
wpa_printf(MSG_DEBUG, "Interworking: Scan results available - start " wpa_msg(wpa_s, MSG_DEBUG,
"ANQP fetch"); "Interworking: Scan results available - start ANQP fetch");
interworking_start_fetch_anqp(wpa_s); interworking_start_fetch_anqp(wpa_s);
} }
@ -2924,8 +2939,8 @@ int interworking_select(struct wpa_supplicant *wpa_s, int auto_select,
wpa_s->auto_select = !!auto_select; wpa_s->auto_select = !!auto_select;
wpa_s->fetch_all_anqp = 0; wpa_s->fetch_all_anqp = 0;
wpa_s->fetch_osu_info = 0; wpa_s->fetch_osu_info = 0;
wpa_printf(MSG_DEBUG, "Interworking: Start scan for network " wpa_msg(wpa_s, MSG_DEBUG,
"selection"); "Interworking: Start scan for network selection");
wpa_s->scan_res_handler = interworking_scan_res_handler; wpa_s->scan_res_handler = interworking_scan_res_handler;
wpa_s->normal_scans = 0; wpa_s->normal_scans = 0;
wpa_s->scan_req = MANUAL_SCAN_REQ; wpa_s->scan_req = MANUAL_SCAN_REQ;
@ -2986,8 +3001,8 @@ int gas_send_request(struct wpa_supplicant *wpa_s, const u8 *dst,
if (freq <= 0) if (freq <= 0)
return -1; return -1;
wpa_printf(MSG_DEBUG, "GAS request to " MACSTR " (freq %d MHz)", wpa_msg(wpa_s, MSG_DEBUG, "GAS request to " MACSTR " (freq %d MHz)",
MAC2STR(dst), freq); MAC2STR(dst), freq);
wpa_hexdump_buf(MSG_DEBUG, "Advertisement Protocol ID", adv_proto); wpa_hexdump_buf(MSG_DEBUG, "Advertisement Protocol ID", adv_proto);
wpa_hexdump_buf(MSG_DEBUG, "GAS Query", query); wpa_hexdump_buf(MSG_DEBUG, "GAS Query", query);
@ -3013,12 +3028,12 @@ int gas_send_request(struct wpa_supplicant *wpa_s, const u8 *dst,
res = gas_query_req(wpa_s->gas, dst, freq, buf, gas_resp_cb, wpa_s); res = gas_query_req(wpa_s->gas, dst, freq, buf, gas_resp_cb, wpa_s);
if (res < 0) { if (res < 0) {
wpa_printf(MSG_DEBUG, "GAS: Failed to send Query Request"); wpa_msg(wpa_s, MSG_DEBUG, "GAS: Failed to send Query Request");
wpabuf_free(buf); wpabuf_free(buf);
ret = -1; ret = -1;
} else } else
wpa_printf(MSG_DEBUG, "GAS: Query started with dialog token " wpa_msg(wpa_s, MSG_DEBUG,
"%u", res); "GAS: Query started with dialog token %u", res);
return ret; return ret;
} }