Use wpa_msg() instead of wpa_printf()

This converts number of debugging messages to use wpa_msg() in order
to allow the interface name to be shown with the messages.

A new function, wpa_dbg(), is introduced to allow
CONFIG_NO_STDOUT_DEBUG=y builds to remove the debug strings. This is
otherwise identical with wpa_msg(), but it gets compiled out if stdout
debugging is disabled.
This commit is contained in:
Ben Greear 2011-02-10 20:14:46 +02:00 committed by Jouni Malinen
parent 2944824315
commit f049052b9e
7 changed files with 695 additions and 604 deletions

File diff suppressed because it is too large Load diff

View file

@ -36,6 +36,7 @@ enum {
#define wpa_hexdump_ascii_key(l,t,b,le) do { } while (0)
#define wpa_debug_open_file(p) do { } while (0)
#define wpa_debug_close_file() do { } while (0)
#define wpa_dbg(args...) do { } while (0)
#else /* CONFIG_NO_STDOUT_DEBUG */
@ -141,6 +142,14 @@ void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
size_t len);
/*
* wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
* binary size. As such, it should be used with debugging messages that are not
* needed in the control interface while wpa_msg() has to be used for anything
* that needs to shown to control interface monitors.
*/
#define wpa_dbg(args...) wpa_msg(args)
#endif /* CONFIG_NO_STDOUT_DEBUG */

View file

@ -65,8 +65,8 @@ static void wpa_bss_remove(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
dl_list_del(&bss->list);
dl_list_del(&bss->list_id);
wpa_s->num_bss--;
wpa_printf(MSG_DEBUG, "BSS: Remove id %u BSSID " MACSTR " SSID '%s'",
bss->id, MAC2STR(bss->bssid),
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: Remove id %u BSSID " MACSTR
" SSID '%s'", bss->id, MAC2STR(bss->bssid),
wpa_ssid_txt(bss->ssid, bss->ssid_len));
wpas_notify_bss_removed(wpa_s, bss->bssid, bss->id);
os_free(bss);
@ -133,7 +133,8 @@ static void wpa_bss_add(struct wpa_supplicant *wpa_s,
dl_list_add_tail(&wpa_s->bss, &bss->list);
dl_list_add_tail(&wpa_s->bss_id, &bss->list_id);
wpa_s->num_bss++;
wpa_printf(MSG_DEBUG, "BSS: Add new id %u BSSID " MACSTR " SSID '%s'",
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: Add new id %u BSSID " MACSTR
" SSID '%s'",
bss->id, MAC2STR(bss->bssid), wpa_ssid_txt(ssid, ssid_len));
wpas_notify_bss_added(wpa_s, bss->bssid, bss->id);
if (wpa_s->num_bss > wpa_s->conf->bss_max_count) {
@ -317,7 +318,7 @@ static int wpa_bss_in_use(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
void wpa_bss_update_start(struct wpa_supplicant *wpa_s)
{
wpa_s->bss_update_idx++;
wpa_printf(MSG_DEBUG, "BSS: Start scan result update %u",
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: Start scan result update %u",
wpa_s->bss_update_idx);
}
@ -330,12 +331,12 @@ void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s,
ssid = wpa_scan_get_ie(res, WLAN_EID_SSID);
if (ssid == NULL) {
wpa_printf(MSG_DEBUG, "BSS: No SSID IE included for " MACSTR,
MAC2STR(res->bssid));
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: No SSID IE included for "
MACSTR, MAC2STR(res->bssid));
return;
}
if (ssid[1] > 32) {
wpa_printf(MSG_DEBUG, "BSS: Too long SSID IE included for "
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: Too long SSID IE included for "
MACSTR, MAC2STR(res->bssid));
return;
}
@ -412,8 +413,8 @@ void wpa_bss_update_end(struct wpa_supplicant *wpa_s, struct scan_info *info,
if (bss->last_update_idx < wpa_s->bss_update_idx)
bss->scan_miss_count++;
if (bss->scan_miss_count >= WPA_BSS_EXPIRATION_SCAN_COUNT) {
wpa_printf(MSG_DEBUG, "BSS: Expire BSS %u due to no "
"match in scan", bss->id);
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: Expire BSS %u due to "
"no match in scan", bss->id);
wpa_bss_remove(wpa_s, bss);
}
}
@ -437,8 +438,8 @@ static void wpa_bss_timeout(void *eloop_ctx, void *timeout_ctx)
continue;
if (os_time_before(&bss->last_update, &t)) {
wpa_printf(MSG_DEBUG, "BSS: Expire BSS %u due to age",
bss->id);
wpa_dbg(wpa_s, MSG_DEBUG, "BSS: Expire BSS %u due to "
"age", bss->id);
wpa_bss_remove(wpa_s, bss);
} else
break;

View file

@ -53,22 +53,22 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
if (wpa_s->conf->ap_scan == 1 && wpa_s->current_ssid)
return 0;
wpa_printf(MSG_DEBUG, "Select network based on association "
wpa_dbg(wpa_s, MSG_DEBUG, "Select network based on association "
"information");
ssid = wpa_supplicant_get_ssid(wpa_s);
if (ssid == NULL) {
wpa_printf(MSG_INFO, "No network configuration found for the "
"current AP");
wpa_msg(wpa_s, MSG_INFO,
"No network configuration found for the current AP");
return -1;
}
if (ssid->disabled) {
wpa_printf(MSG_DEBUG, "Selected network is disabled");
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is disabled");
return -1;
}
wpa_printf(MSG_DEBUG, "Network configuration found for the current "
"AP");
wpa_dbg(wpa_s, MSG_DEBUG, "Network configuration found for the "
"current AP");
if (ssid->key_mgmt & (WPA_KEY_MGMT_PSK | WPA_KEY_MGMT_IEEE8021X |
WPA_KEY_MGMT_WPA_NONE |
WPA_KEY_MGMT_FT_PSK | WPA_KEY_MGMT_FT_IEEE8021X |
@ -153,8 +153,8 @@ static void wpa_find_assoc_pmkid(struct wpa_supplicant *wpa_s)
}
}
wpa_printf(MSG_DEBUG, "RSN: PMKID from assoc IE %sfound from PMKSA "
"cache", pmksa_set == 0 ? "" : "not ");
wpa_dbg(wpa_s, MSG_DEBUG, "RSN: PMKID from assoc IE %sfound from "
"PMKSA cache", pmksa_set == 0 ? "" : "not ");
}
@ -162,10 +162,11 @@ static void wpa_supplicant_event_pmkid_candidate(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
{
if (data == NULL) {
wpa_printf(MSG_DEBUG, "RSN: No data in PMKID candidate event");
wpa_dbg(wpa_s, MSG_DEBUG, "RSN: No data in PMKID candidate "
"event");
return;
}
wpa_printf(MSG_DEBUG, "RSN: PMKID candidate event - bssid=" MACSTR
wpa_dbg(wpa_s, MSG_DEBUG, "RSN: PMKID candidate event - bssid=" MACSTR
" index=%d preauth=%d",
MAC2STR(data->pmkid_candidate.bssid),
data->pmkid_candidate.index,
@ -240,12 +241,13 @@ int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
aka = 0;
if (!sim && !aka) {
wpa_printf(MSG_DEBUG, "Selected network is configured to use "
"SIM, but neither EAP-SIM nor EAP-AKA are enabled");
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is configured to "
"use SIM, but neither EAP-SIM nor EAP-AKA are "
"enabled");
return 0;
}
wpa_printf(MSG_DEBUG, "Selected network is configured to use SIM "
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is configured to use SIM "
"(sim=%d aka=%d) - initialize PCSC", sim, aka);
if (sim && aka)
type = SCARD_TRY_BOTH;
@ -256,7 +258,7 @@ int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
wpa_s->scard = scard_init(type);
if (wpa_s->scard == NULL) {
wpa_printf(MSG_WARNING, "Failed to initialize SIM "
wpa_msg(wpa_s, MSG_WARNING, "Failed to initialize SIM "
"(pcsc-lite)");
return -1;
}
@ -326,38 +328,39 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
proto_match++;
if (wpa_parse_wpa_ie(rsn_ie, 2 + rsn_ie[1], &ie)) {
wpa_printf(MSG_DEBUG, " skip RSN IE - parse failed");
wpa_dbg(wpa_s, MSG_DEBUG, " skip RSN IE - parse "
"failed");
break;
}
if (wep_ok &&
(ie.group_cipher & (WPA_CIPHER_WEP40 | WPA_CIPHER_WEP104)))
{
wpa_printf(MSG_DEBUG, " selected based on TSN in "
"RSN IE");
wpa_dbg(wpa_s, MSG_DEBUG, " selected based on TSN "
"in RSN IE");
return 1;
}
if (!(ie.proto & ssid->proto)) {
wpa_printf(MSG_DEBUG, " skip RSN IE - proto "
wpa_dbg(wpa_s, MSG_DEBUG, " skip RSN IE - proto "
"mismatch");
break;
}
if (!(ie.pairwise_cipher & ssid->pairwise_cipher)) {
wpa_printf(MSG_DEBUG, " skip RSN IE - PTK cipher "
"mismatch");
wpa_dbg(wpa_s, MSG_DEBUG, " skip RSN IE - PTK "
"cipher mismatch");
break;
}
if (!(ie.group_cipher & ssid->group_cipher)) {
wpa_printf(MSG_DEBUG, " skip RSN IE - GTK cipher "
"mismatch");
wpa_dbg(wpa_s, MSG_DEBUG, " skip RSN IE - GTK "
"cipher mismatch");
break;
}
if (!(ie.key_mgmt & ssid->key_mgmt)) {
wpa_printf(MSG_DEBUG, " skip RSN IE - key mgmt "
wpa_dbg(wpa_s, MSG_DEBUG, " skip RSN IE - key mgmt "
"mismatch");
break;
}
@ -365,13 +368,13 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_IEEE80211W
if (!(ie.capabilities & WPA_CAPABILITY_MFPC) &&
ssid->ieee80211w == MGMT_FRAME_PROTECTION_REQUIRED) {
wpa_printf(MSG_DEBUG, " skip RSN IE - no mgmt frame "
"protection");
wpa_dbg(wpa_s, MSG_DEBUG, " skip RSN IE - no mgmt "
"frame protection");
break;
}
#endif /* CONFIG_IEEE80211W */
wpa_printf(MSG_DEBUG, " selected based on RSN IE");
wpa_dbg(wpa_s, MSG_DEBUG, " selected based on RSN IE");
return 1;
}
@ -380,49 +383,50 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
proto_match++;
if (wpa_parse_wpa_ie(wpa_ie, 2 + wpa_ie[1], &ie)) {
wpa_printf(MSG_DEBUG, " skip WPA IE - parse failed");
wpa_dbg(wpa_s, MSG_DEBUG, " skip WPA IE - parse "
"failed");
break;
}
if (wep_ok &&
(ie.group_cipher & (WPA_CIPHER_WEP40 | WPA_CIPHER_WEP104)))
{
wpa_printf(MSG_DEBUG, " selected based on TSN in "
"WPA IE");
wpa_dbg(wpa_s, MSG_DEBUG, " selected based on TSN "
"in WPA IE");
return 1;
}
if (!(ie.proto & ssid->proto)) {
wpa_printf(MSG_DEBUG, " skip WPA IE - proto "
wpa_dbg(wpa_s, MSG_DEBUG, " skip WPA IE - proto "
"mismatch");
break;
}
if (!(ie.pairwise_cipher & ssid->pairwise_cipher)) {
wpa_printf(MSG_DEBUG, " skip WPA IE - PTK cipher "
"mismatch");
wpa_dbg(wpa_s, MSG_DEBUG, " skip WPA IE - PTK "
"cipher mismatch");
break;
}
if (!(ie.group_cipher & ssid->group_cipher)) {
wpa_printf(MSG_DEBUG, " skip WPA IE - GTK cipher "
"mismatch");
wpa_dbg(wpa_s, MSG_DEBUG, " skip WPA IE - GTK "
"cipher mismatch");
break;
}
if (!(ie.key_mgmt & ssid->key_mgmt)) {
wpa_printf(MSG_DEBUG, " skip WPA IE - key mgmt "
wpa_dbg(wpa_s, MSG_DEBUG, " skip WPA IE - key mgmt "
"mismatch");
break;
}
wpa_printf(MSG_DEBUG, " selected based on WPA IE");
wpa_dbg(wpa_s, MSG_DEBUG, " selected based on WPA IE");
return 1;
}
if ((ssid->proto & (WPA_PROTO_WPA | WPA_PROTO_RSN)) &&
wpa_key_mgmt_wpa(ssid->key_mgmt) && proto_match == 0) {
wpa_printf(MSG_DEBUG, " skip - no WPA/RSN proto match");
wpa_dbg(wpa_s, MSG_DEBUG, " skip - no WPA/RSN proto match");
return 0;
}
@ -466,12 +470,11 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
ie = wpa_scan_get_ie(bss, WLAN_EID_RSN);
rsn_ie_len = ie ? ie[1] : 0;
wpa_printf(MSG_DEBUG, "%d: " MACSTR " ssid='%s' "
wpa_dbg(wpa_s, MSG_DEBUG, "%d: " MACSTR " ssid='%s' "
"wpa_ie_len=%u rsn_ie_len=%u caps=0x%x level=%d%s",
i, MAC2STR(bss->bssid), wpa_ssid_txt(ssid_, ssid_len),
wpa_ie_len, rsn_ie_len, bss->caps, bss->level,
wpa_scan_get_vendor_ie(bss, WPS_IE_VENDOR_TYPE) ?
" wps" : "");
wpa_scan_get_vendor_ie(bss, WPS_IE_VENDOR_TYPE) ? " wps" : "");
e = wpa_blacklist_get(wpa_s, bss->bssid);
if (e) {
@ -488,14 +491,14 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
limit = 0;
}
if (e->count > limit) {
wpa_printf(MSG_DEBUG, " skip - blacklisted "
wpa_dbg(wpa_s, MSG_DEBUG, " skip - blacklisted "
"(count=%d limit=%d)", e->count, limit);
return 0;
}
}
if (ssid_len == 0) {
wpa_printf(MSG_DEBUG, " skip - SSID not known");
wpa_dbg(wpa_s, MSG_DEBUG, " skip - SSID not known");
return 0;
}
@ -505,13 +508,14 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
int check_ssid = wpa ? 1 : (ssid->ssid_len != 0);
if (ssid->disabled) {
wpa_printf(MSG_DEBUG, " skip - disabled");
wpa_dbg(wpa_s, MSG_DEBUG, " skip - disabled");
continue;
}
#ifdef CONFIG_WPS
if ((ssid->key_mgmt & WPA_KEY_MGMT_WPS) && e && e->count > 0) {
wpa_printf(MSG_DEBUG, " skip - blacklisted (WPS)");
wpa_dbg(wpa_s, MSG_DEBUG, " skip - blacklisted "
"(WPS)");
continue;
}
@ -533,13 +537,13 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
if (check_ssid &&
(ssid_len != ssid->ssid_len ||
os_memcmp(ssid_, ssid->ssid, ssid_len) != 0)) {
wpa_printf(MSG_DEBUG, " skip - SSID mismatch");
wpa_dbg(wpa_s, MSG_DEBUG, " skip - SSID mismatch");
continue;
}
if (ssid->bssid_set &&
os_memcmp(bss->bssid, ssid->bssid, ETH_ALEN) != 0) {
wpa_printf(MSG_DEBUG, " skip - BSSID mismatch");
wpa_dbg(wpa_s, MSG_DEBUG, " skip - BSSID mismatch");
continue;
}
@ -550,24 +554,25 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
!(ssid->key_mgmt & WPA_KEY_MGMT_NONE) &&
!(ssid->key_mgmt & WPA_KEY_MGMT_WPS) &&
!(ssid->key_mgmt & WPA_KEY_MGMT_IEEE8021X_NO_WPA)) {
wpa_printf(MSG_DEBUG, " skip - non-WPA network not "
"allowed");
wpa_dbg(wpa_s, MSG_DEBUG, " skip - non-WPA network "
"not allowed");
continue;
}
if (!wpa && !wpa_supplicant_match_privacy(bss, ssid)) {
wpa_printf(MSG_DEBUG, " skip - privacy mismatch");
wpa_dbg(wpa_s, MSG_DEBUG, " skip - privacy "
"mismatch");
continue;
}
if (!wpa && (bss->caps & IEEE80211_CAP_IBSS)) {
wpa_printf(MSG_DEBUG, " skip - IBSS (adhoc) "
wpa_dbg(wpa_s, MSG_DEBUG, " skip - IBSS (adhoc) "
"network");
continue;
}
if (!freq_allowed(ssid->freq_list, bss->freq)) {
wpa_printf(MSG_DEBUG, " skip - frequency not "
wpa_dbg(wpa_s, MSG_DEBUG, " skip - frequency not "
"allowed");
continue;
}
@ -597,7 +602,7 @@ wpa_supplicant_select_bss(struct wpa_supplicant *wpa_s,
{
size_t i;
wpa_printf(MSG_DEBUG, "Selecting BSS from priority group %d",
wpa_dbg(wpa_s, MSG_DEBUG, "Selecting BSS from priority group %d",
group->priority);
for (i = 0; i < scan_res->num; i++) {
@ -613,7 +618,8 @@ wpa_supplicant_select_bss(struct wpa_supplicant *wpa_s,
ssid = ie ? ie + 2 : (u8 *) "";
ssid_len = ie ? ie[1] : 0;
wpa_printf(MSG_DEBUG, " selected BSS " MACSTR " ssid='%s'",
wpa_dbg(wpa_s, MSG_DEBUG, " selected BSS " MACSTR
" ssid='%s'",
MAC2STR(bss->bssid), wpa_ssid_txt(ssid, ssid_len));
return wpa_bss_get(wpa_s, bss->bssid, ssid, ssid_len);
}
@ -640,8 +646,8 @@ wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
}
if (selected == NULL && wpa_s->blacklist) {
wpa_printf(MSG_DEBUG, "No APs found - clear blacklist "
"and try again");
wpa_dbg(wpa_s, MSG_DEBUG, "No APs found - clear "
"blacklist and try again");
wpa_blacklist_clear(wpa_s);
wpa_s->blacklist_cleared++;
} else if (selected == NULL)
@ -702,8 +708,8 @@ void wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
}
wpa_supplicant_associate(wpa_s, selected, ssid);
} else {
wpa_printf(MSG_DEBUG, "Already associated with the selected "
"AP");
wpa_dbg(wpa_s, MSG_DEBUG, "Already associated with the "
"selected AP");
}
}
@ -795,17 +801,17 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
if (!current_bss)
return 1; /* current BSS not seen in scan results */
wpa_printf(MSG_DEBUG, "Considering within-ESS reassociation");
wpa_printf(MSG_DEBUG, "Current BSS: " MACSTR " level=%d",
wpa_dbg(wpa_s, MSG_DEBUG, "Considering within-ESS reassociation");
wpa_dbg(wpa_s, MSG_DEBUG, "Current BSS: " MACSTR " level=%d",
MAC2STR(current_bss->bssid), current_bss->level);
wpa_printf(MSG_DEBUG, "Selected BSS: " MACSTR " level=%d",
wpa_dbg(wpa_s, MSG_DEBUG, "Selected BSS: " MACSTR " level=%d",
MAC2STR(selected->bssid), selected->level);
if (wpa_s->current_ssid->bssid_set &&
os_memcmp(selected->bssid, wpa_s->current_ssid->bssid, ETH_ALEN) ==
0) {
wpa_printf(MSG_DEBUG, "Allow reassociation - selected BSS has "
"preferred BSSID");
wpa_dbg(wpa_s, MSG_DEBUG, "Allow reassociation - selected BSS "
"has preferred BSSID");
return 1;
}
@ -823,8 +829,8 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
min_diff = 5;
}
if (abs(current_bss->level - selected->level) < min_diff) {
wpa_printf(MSG_DEBUG, "Skip roam - too small difference in "
"signal level");
wpa_dbg(wpa_s, MSG_DEBUG, "Skip roam - too small difference "
"in signal level");
return 0;
}
@ -853,7 +859,7 @@ static void _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
if (scan_res == NULL) {
if (wpa_s->conf->ap_scan == 2 || ap)
return;
wpa_printf(MSG_DEBUG, "Failed to get scan results - try "
wpa_dbg(wpa_s, MSG_DEBUG, "Failed to get scan results - try "
"scanning again");
wpa_supplicant_req_new_scan(wpa_s, 1, 0);
return;
@ -889,12 +895,12 @@ static void _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
}
if (ap) {
wpa_printf(MSG_DEBUG, "Ignore scan results in AP mode");
wpa_dbg(wpa_s, MSG_DEBUG, "Ignore scan results in AP mode");
wpa_scan_results_free(scan_res);
return;
}
wpa_printf(MSG_DEBUG, "%s: New scan results available", wpa_s->ifname);
wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available");
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
wpas_notify_scan_results(wpa_s);
@ -930,10 +936,10 @@ static void _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
wpa_supplicant_connect(wpa_s, selected, ssid);
} else {
wpa_scan_results_free(scan_res);
wpa_printf(MSG_DEBUG, "No suitable network found");
wpa_dbg(wpa_s, MSG_DEBUG, "No suitable network found");
ssid = wpa_supplicant_pick_new_network(wpa_s);
if (ssid) {
wpa_printf(MSG_DEBUG, "Setup a new network");
wpa_dbg(wpa_s, MSG_DEBUG, "Setup a new network");
wpa_supplicant_associate(wpa_s, NULL, ssid);
} else {
int timeout_sec = 5;
@ -974,9 +980,8 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
if (rn == NULL || rn[0] == '\0')
return;
wpa_printf(MSG_DEBUG, "%s: Checking for other virtual interfaces "
"sharing same radio (%s) in event_scan_results",
wpa_s->ifname, rn);
wpa_dbg(wpa_s, MSG_DEBUG, "Checking for other virtual interfaces "
"sharing same radio (%s) in event_scan_results", rn);
for (ifs = wpa_s->global->ifaces; ifs; ifs = ifs->next) {
if (ifs == wpa_s || !ifs->driver->get_radio_name)
@ -1000,7 +1005,7 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
int l, len, found = 0, wpa_found, rsn_found;
const u8 *p;
wpa_printf(MSG_DEBUG, "Association info event");
wpa_dbg(wpa_s, MSG_DEBUG, "Association info event");
if (data->assoc_info.req_ies)
wpa_hexdump(MSG_DEBUG, "req_ies", data->assoc_info.req_ies,
data->assoc_info.req_ies_len);
@ -1012,7 +1017,8 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
data->assoc_info.beacon_ies,
data->assoc_info.beacon_ies_len);
if (data->assoc_info.freq)
wpa_printf(MSG_DEBUG, "freq=%u MHz", data->assoc_info.freq);
wpa_dbg(wpa_s, MSG_DEBUG, "freq=%u MHz",
data->assoc_info.freq);
p = data->assoc_info.req_ies;
l = data->assoc_info.req_ies_len;
@ -1049,7 +1055,7 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
data->assoc_info.resp_ies,
data->assoc_info.resp_ies_len,
bssid) < 0) {
wpa_printf(MSG_DEBUG, "FT: Validation of "
wpa_dbg(wpa_s, MSG_DEBUG, "FT: Validation of "
"Reassociation Response failed");
wpa_supplicant_deauthenticate(
wpa_s, WLAN_REASON_INVALID_IE);
@ -1066,8 +1072,8 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s,
struct wpabuf *wps;
wps = ieee802_11_vendor_ie_concat(p, l, WPS_IE_VENDOR_TYPE);
if (wps == NULL) {
wpa_printf(MSG_INFO, "WPS-STRICT: AP did not include "
"WPS IE in (Re)Association Response");
wpa_msg(wpa_s, MSG_INFO, "WPS-STRICT: AP did not "
"include WPS IE in (Re)Association Response");
return -1;
}
@ -1177,7 +1183,7 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME) ||
(wpa_drv_get_bssid(wpa_s, bssid) >= 0 &&
os_memcmp(bssid, wpa_s->bssid, ETH_ALEN) != 0)) {
wpa_msg(wpa_s, MSG_DEBUG, "Associated to a new BSS: BSSID="
wpa_dbg(wpa_s, MSG_DEBUG, "Associated to a new BSS: BSSID="
MACSTR, MAC2STR(bssid));
random_add_randomness(bssid, ETH_ALEN);
bssid_changed = os_memcmp(wpa_s->bssid, bssid, ETH_ALEN);
@ -1280,9 +1286,9 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
if (age.sec == 0 && age.usec < 100000 &&
os_memcmp(wpa_s->pending_eapol_rx_src, bssid, ETH_ALEN) ==
0) {
wpa_printf(MSG_DEBUG, "Process pending EAPOL frame "
"that was received just before association "
"notification");
wpa_dbg(wpa_s, MSG_DEBUG, "Process pending EAPOL "
"frame that was received just before "
"association notification");
wpa_supplicant_rx_eapol(
wpa_s, wpa_s->pending_eapol_rx_src,
wpabuf_head(wpa_s->pending_eapol_rx),
@ -1297,8 +1303,8 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
bgscan_deinit(wpa_s);
if (wpa_s->current_ssid && wpa_s->current_ssid->bgscan) {
if (bgscan_init(wpa_s, wpa_s->current_ssid)) {
wpa_printf(MSG_DEBUG, "Failed to initialize "
"bgscan");
wpa_dbg(wpa_s, MSG_DEBUG, "Failed to "
"initialize bgscan");
/*
* Live without bgscan; it is only used as a
* roaming optimization, so the initial
@ -1347,7 +1353,7 @@ static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s,
* generating streams of disconnected events when configuring
* IBSS for WPA-None. Ignore them for now.
*/
wpa_printf(MSG_DEBUG, "Disconnect event - ignore in "
wpa_dbg(wpa_s, MSG_DEBUG, "Disconnect event - ignore in "
"IBSS/WPA-None mode");
return;
}
@ -1359,14 +1365,14 @@ static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s,
}
if (!wpa_s->auto_reconnect_disabled ||
wpa_s->key_mgmt == WPA_KEY_MGMT_WPS) {
wpa_printf(MSG_DEBUG, "WPA: Auto connect enabled: try to "
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Auto connect enabled: try to "
"reconnect (wps=%d)",
wpa_s->key_mgmt == WPA_KEY_MGMT_WPS);
if (wpa_s->wpa_state >= WPA_ASSOCIATING)
wpa_supplicant_req_scan(wpa_s, 0, 100000);
} else {
wpa_printf(MSG_DEBUG, "WPA: Auto connect disabled: do not try "
"to re-connect");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Auto connect disabled: do not "
"try to re-connect");
wpa_s->reassociate = 0;
wpa_s->disconnected = 1;
}
@ -1379,7 +1385,7 @@ static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s,
" reason=%d",
MAC2STR(bssid), reason_code);
if (wpa_supplicant_dynamic_keys(wpa_s)) {
wpa_printf(MSG_DEBUG, "Disconnect event - remove keys");
wpa_dbg(wpa_s, MSG_DEBUG, "Disconnect event - remove keys");
wpa_s->keys_cleared = 0;
wpa_clear_keys(wpa_s, wpa_s->bssid);
}
@ -1394,8 +1400,8 @@ static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s,
* requires us to remain in authenticating state to allow the
* second authentication attempt to be continued properly.
*/
wpa_printf(MSG_DEBUG, "SME: Allow pending authentication to "
"proceed after disconnection event");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Allow pending authentication "
"to proceed after disconnection event");
wpa_supplicant_set_state(wpa_s, WPA_AUTHENTICATING);
os_memcpy(wpa_s->pending_bssid, prev_pending_bssid, ETH_ALEN);
}
@ -1412,7 +1418,7 @@ static void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx,
if (!wpa_s->pending_mic_error_report)
return;
wpa_printf(MSG_DEBUG, "WPA: Sending pending MIC error report");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Sending pending MIC error report");
wpa_sm_key_request(wpa_s->wpa, 1, wpa_s->pending_mic_error_pairwise);
wpa_s->pending_mic_error_report = 0;
}
@ -1487,8 +1493,8 @@ wpa_supplicant_event_michael_mic_failure(struct wpa_supplicant *wpa_s,
sec = os_random() % 60;
else
sec = WPA_GET_BE32(rval) % 60;
wpa_printf(MSG_DEBUG, "WPA: Delay MIC error report %d "
"seconds", sec);
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Delay MIC error "
"report %d seconds", sec);
wpa_s->pending_mic_error_report = 1;
wpa_s->pending_mic_error_pairwise = pairwise;
eloop_cancel_timeout(
@ -1535,14 +1541,14 @@ wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
if (!wpa_s->interface_removed)
break;
wpa_s->interface_removed = 0;
wpa_printf(MSG_DEBUG, "Configured interface was added.");
wpa_dbg(wpa_s, MSG_DEBUG, "Configured interface was added");
if (wpa_supplicant_driver_init(wpa_s) < 0) {
wpa_printf(MSG_INFO, "Failed to initialize the driver "
"after interface was added.");
wpa_msg(wpa_s, MSG_INFO, "Failed to initialize the "
"driver after interface was added");
}
break;
case EVENT_INTERFACE_REMOVED:
wpa_printf(MSG_DEBUG, "Configured interface was removed.");
wpa_dbg(wpa_s, MSG_DEBUG, "Configured interface was removed");
wpa_s->interface_removed = 1;
wpa_supplicant_mark_disassoc(wpa_s);
l2_packet_deinit(wpa_s->l2);
@ -1624,18 +1630,18 @@ static void ft_rx_action(struct wpa_supplicant *wpa_s, const u8 *data,
sta_addr = data + 1;
target_ap_addr = data + 1 + ETH_ALEN;
status = WPA_GET_LE16(data + 1 + 2 * ETH_ALEN);
wpa_printf(MSG_DEBUG, "FT: Received FT Action Response: STA " MACSTR
" TargetAP " MACSTR " status %u",
wpa_dbg(wpa_s, MSG_DEBUG, "FT: Received FT Action Response: STA "
MACSTR " TargetAP " MACSTR " status %u",
MAC2STR(sta_addr), MAC2STR(target_ap_addr), status);
if (os_memcmp(sta_addr, wpa_s->own_addr, ETH_ALEN) != 0) {
wpa_printf(MSG_DEBUG, "FT: Foreign STA Address " MACSTR
wpa_dbg(wpa_s, MSG_DEBUG, "FT: Foreign STA Address " MACSTR
" in FT Action Response", MAC2STR(sta_addr));
return;
}
if (status) {
wpa_printf(MSG_DEBUG, "FT: FT Action Response indicates "
wpa_dbg(wpa_s, MSG_DEBUG, "FT: FT Action Response indicates "
"failure (status code %d)", status);
/* TODO: report error to FT code(?) */
return;
@ -1696,12 +1702,12 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED &&
event != EVENT_INTERFACE_ENABLED &&
event != EVENT_INTERFACE_STATUS) {
wpa_printf(MSG_DEBUG, "Ignore event %d while interface is "
wpa_dbg(wpa_s, MSG_DEBUG, "Ignore event %d while interface is "
"disabled", event);
return;
}
wpa_printf(MSG_DEBUG, "Event %d received on interface %s",
wpa_dbg(wpa_s, MSG_DEBUG, "Event %d received on interface %s",
event, wpa_s->ifname);
switch (event) {
@ -1712,12 +1718,12 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
wpa_supplicant_event_assoc(wpa_s, data);
break;
case EVENT_DISASSOC:
wpa_printf(MSG_DEBUG, "Disassociation notification");
wpa_dbg(wpa_s, MSG_DEBUG, "Disassociation notification");
if (data) {
wpa_printf(MSG_DEBUG, " * reason %u",
wpa_dbg(wpa_s, MSG_DEBUG, " * reason %u",
data->disassoc_info.reason_code);
if (data->disassoc_info.addr)
wpa_printf(MSG_DEBUG, " * address " MACSTR,
wpa_dbg(wpa_s, MSG_DEBUG, " * address " MACSTR,
MAC2STR(data->disassoc_info.addr));
}
#ifdef CONFIG_AP
@ -1744,13 +1750,14 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
/* fall through */
case EVENT_DEAUTH:
if (event == EVENT_DEAUTH) {
wpa_printf(MSG_DEBUG, "Deauthentication notification");
wpa_dbg(wpa_s, MSG_DEBUG,
"Deauthentication notification");
if (data) {
reason_code = data->deauth_info.reason_code;
wpa_printf(MSG_DEBUG, " * reason %u",
wpa_dbg(wpa_s, MSG_DEBUG, " * reason %u",
data->deauth_info.reason_code);
if (data->deauth_info.addr) {
wpa_printf(MSG_DEBUG, " * address "
wpa_dbg(wpa_s, MSG_DEBUG, " * address "
MACSTR,
MAC2STR(data->deauth_info.
addr));
@ -1832,9 +1839,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
break;
#ifdef CONFIG_AP
case EVENT_TX_STATUS:
wpa_printf(MSG_DEBUG, "EVENT_TX_STATUS on %s dst=" MACSTR
wpa_dbg(wpa_s, MSG_DEBUG, "EVENT_TX_STATUS dst=" MACSTR
" type=%d stype=%d",
wpa_s->ifname, MAC2STR(data->tx_status.dst),
MAC2STR(data->tx_status.dst),
data->tx_status.type, data->tx_status.stype);
if (wpa_s->ap_iface == NULL) {
#ifdef CONFIG_P2P
@ -1851,8 +1858,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
break;
}
#ifdef CONFIG_P2P
wpa_printf(MSG_DEBUG, "EVENT_TX_STATUS pending_dst=" MACSTR,
MAC2STR(wpa_s->parent->pending_action_dst));
wpa_dbg(wpa_s, MSG_DEBUG, "EVENT_TX_STATUS pending_dst="
MACSTR, MAC2STR(wpa_s->parent->pending_action_dst));
/*
* Catch TX status events for Action frames we sent via group
* interface in GO mode.
@ -1912,15 +1919,15 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
break;
}
#endif /* CONFIG_P2P */
wpa_printf(MSG_DEBUG, "AP: ignore received management "
"frame in non-AP mode");
wpa_dbg(wpa_s, MSG_DEBUG, "AP: ignore received "
"management frame in non-AP mode");
break;
}
ap_mgmt_rx(wpa_s, &data->rx_mgmt);
break;
#endif /* CONFIG_AP */
case EVENT_RX_ACTION:
wpa_printf(MSG_DEBUG, "Received Action frame: SA=" MACSTR
wpa_dbg(wpa_s, MSG_DEBUG, "Received Action frame: SA=" MACSTR
" Category=%u DataLen=%d freq=%d MHz",
MAC2STR(data->rx_action.sa),
data->rx_action.category, (int) data->rx_action.len,
@ -2047,7 +2054,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
data->signal_change.current_txrate);
break;
case EVENT_INTERFACE_ENABLED:
wpa_printf(MSG_DEBUG, "Interface was enabled");
wpa_dbg(wpa_s, MSG_DEBUG, "Interface was enabled");
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
#ifdef CONFIG_AP
if (!wpa_s->ap_iface) {
@ -2064,7 +2071,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
break;
case EVENT_INTERFACE_DISABLED:
wpa_printf(MSG_DEBUG, "Interface was disabled");
wpa_dbg(wpa_s, MSG_DEBUG, "Interface was disabled");
wpa_supplicant_mark_disassoc(wpa_s);
wpa_supplicant_set_state(wpa_s, WPA_INTERFACE_DISABLED);
break;
@ -2081,7 +2088,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
#endif /* CONFIG_P2P */
break;
case EVENT_BEST_CHANNEL:
wpa_printf(MSG_DEBUG, "Best channel event received (%d %d %d)",
wpa_dbg(wpa_s, MSG_DEBUG, "Best channel event received "
"(%d %d %d)",
data->best_chan.freq_24, data->best_chan.freq_5,
data->best_chan.freq_overall);
wpa_s->best_24_freq = data->best_chan.freq_24;
@ -2109,7 +2117,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
#endif /* CONFIG_AP */
break;
default:
wpa_printf(MSG_INFO, "Unknown event %d", event);
wpa_msg(wpa_s, MSG_INFO, "Unknown event %d", event);
break;
}
}

View file

@ -44,8 +44,8 @@ static void wpa_supplicant_gen_assoc_event(struct wpa_supplicant *wpa_s)
wpas_notify_network_changed(wpa_s);
}
wpa_supplicant_initiate_eapol(wpa_s);
wpa_printf(MSG_DEBUG, "Already associated with a configured network - "
"generating associated event");
wpa_dbg(wpa_s, MSG_DEBUG, "Already associated with a configured "
"network - generating associated event");
os_memset(&data, 0, sizeof(data));
wpa_supplicant_event(wpa_s, EVENT_ASSOC, &data);
}
@ -100,7 +100,7 @@ static void wpa_supplicant_assoc_try(struct wpa_supplicant *wpa_s,
/* ap_scan=2 mode - try to associate with each SSID. */
if (ssid == NULL) {
wpa_printf(MSG_DEBUG, "wpa_supplicant_scan: Reached "
wpa_dbg(wpa_s, MSG_DEBUG, "wpa_supplicant_assoc_try: Reached "
"end of scan list - go back to beginning");
wpa_s->prev_scan_ssid = WILDCARD_SSID_SCAN;
wpa_supplicant_req_scan(wpa_s, 0, 0);
@ -255,7 +255,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
enum wpa_states prev_state;
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
wpa_printf(MSG_DEBUG, "Skip scan - interface disabled");
wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - interface disabled");
return;
}
@ -266,14 +266,14 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
if (!wpa_supplicant_enabled_networks(wpa_s->conf) &&
!wpa_s->scan_req) {
wpa_printf(MSG_DEBUG, "No enabled networks - do not scan");
wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks - do not scan");
wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);
return;
}
if (wpa_s->conf->ap_scan != 0 &&
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_WIRED)) {
wpa_printf(MSG_DEBUG, "Using wired authentication - "
wpa_dbg(wpa_s, MSG_DEBUG, "Using wired authentication - "
"overriding ap_scan configuration");
wpa_s->conf->ap_scan = 0;
wpas_notify_ap_scan_changed(wpa_s);
@ -373,15 +373,17 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
if (ssid) {
wpa_s->prev_scan_ssid = ssid;
if (max_ssids > 1) {
wpa_printf(MSG_DEBUG, "Include wildcard SSID in the "
"scan request");
wpa_dbg(wpa_s, MSG_DEBUG, "Include wildcard SSID in "
"the scan request");
params.num_ssids++;
}
wpa_printf(MSG_DEBUG, "Starting AP scan for specific SSID(s)");
wpa_dbg(wpa_s, MSG_DEBUG, "Starting AP scan for specific "
"SSID(s)");
} else {
wpa_s->prev_scan_ssid = WILDCARD_SSID_SCAN;
params.num_ssids++;
wpa_printf(MSG_DEBUG, "Starting AP scan for wildcard SSID");
wpa_dbg(wpa_s, MSG_DEBUG, "Starting AP scan for wildcard "
"SSID");
}
#ifdef CONFIG_P2P
@ -396,15 +398,15 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
/* Optimize provisioning state scan based on GO information */
if (wpa_s->p2p_in_provisioning < 5 &&
wpa_s->go_params->freq > 0) {
wpa_printf(MSG_DEBUG, "P2P: Scan only GO preferred "
"frequency %d MHz",
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Scan only GO "
"preferred frequency %d MHz",
wpa_s->go_params->freq);
params.freqs = os_zalloc(2 * sizeof(int));
if (params.freqs)
params.freqs[0] = wpa_s->go_params->freq;
} else if (wpa_s->p2p_in_provisioning < 8 &&
wpa_s->go_params->freq_list[0]) {
wpa_printf(MSG_DEBUG, "P2P: Scan only common "
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Scan only common "
"channels");
int_array_concat(&params.freqs,
wpa_s->go_params->freq_list);
@ -421,8 +423,8 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
* Optimize post-provisioning scan based on channel used
* during provisioning.
*/
wpa_printf(MSG_DEBUG, "WPS: Scan only frequency %u MHz that "
"was used during provisioning", wpa_s->wps_freq);
wpa_dbg(wpa_s, MSG_DEBUG, "WPS: Scan only frequency %u MHz "
"that was used during provisioning", wpa_s->wps_freq);
params.freqs = os_zalloc(2 * sizeof(int));
if (params.freqs)
params.freqs[0] = wpa_s->wps_freq;
@ -450,7 +452,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
#endif /* CONFIG_P2P */
if (params.freqs == NULL && wpa_s->next_scan_freqs) {
wpa_printf(MSG_DEBUG, "Optimize scan based on previously "
wpa_dbg(wpa_s, MSG_DEBUG, "Optimize scan based on previously "
"generated frequency list");
params.freqs = wpa_s->next_scan_freqs;
} else
@ -467,7 +469,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
os_free(params.filter_ssids);
if (ret) {
wpa_printf(MSG_WARNING, "Failed to initiate AP scan.");
wpa_msg(wpa_s, MSG_WARNING, "Failed to initiate AP scan");
if (prev_state != wpa_s->wpa_state)
wpa_supplicant_set_state(wpa_s, prev_state);
wpa_supplicant_req_scan(wpa_s, 1, 0);
@ -502,13 +504,13 @@ void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec)
ssid = ssid->next;
}
if (ssid) {
wpa_msg(wpa_s, MSG_DEBUG, "Not rescheduling scan to "
wpa_dbg(wpa_s, MSG_DEBUG, "Not rescheduling scan to "
"ensure that specific SSID scans occur");
return;
}
}
wpa_msg(wpa_s, MSG_DEBUG, "Setting scan request: %d sec %d usec",
wpa_dbg(wpa_s, MSG_DEBUG, "Setting scan request: %d sec %d usec",
sec, usec);
eloop_cancel_timeout(wpa_supplicant_scan, wpa_s, NULL);
eloop_register_timeout(sec, usec, wpa_supplicant_scan, wpa_s, NULL);
@ -524,7 +526,7 @@ void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec)
*/
void wpa_supplicant_cancel_scan(struct wpa_supplicant *wpa_s)
{
wpa_msg(wpa_s, MSG_DEBUG, "Cancelling scan request");
wpa_dbg(wpa_s, MSG_DEBUG, "Cancelling scan request");
eloop_cancel_timeout(wpa_supplicant_scan, wpa_s, NULL);
}
@ -787,13 +789,13 @@ wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s,
else
scan_res = wpa_drv_get_scan_results2(wpa_s);
if (scan_res == NULL) {
wpa_printf(MSG_DEBUG, "Failed to get scan results");
wpa_dbg(wpa_s, MSG_DEBUG, "Failed to get scan results");
return NULL;
}
#ifdef CONFIG_WPS
if (wpas_wps_in_progress(wpa_s)) {
wpa_printf(MSG_DEBUG, "WPS: Order scan results with WPS "
wpa_dbg(wpa_s, MSG_DEBUG, "WPS: Order scan results with WPS "
"provisioning rules");
compar = wpa_scan_result_wps_compar;
}

View file

@ -48,8 +48,8 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
int i, bssid_changed;
if (bss == NULL) {
wpa_printf(MSG_ERROR, "SME: No scan result available for the "
"network");
wpa_msg(wpa_s, MSG_ERROR, "SME: No scan result available for "
"the network");
return;
}
@ -82,12 +82,12 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
}
}
#endif /* IEEE8021X_EAPOL */
wpa_printf(MSG_DEBUG, "Automatic auth_alg selection: 0x%x",
wpa_dbg(wpa_s, MSG_DEBUG, "Automatic auth_alg selection: 0x%x",
params.auth_alg);
if (ssid->auth_alg) {
params.auth_alg = ssid->auth_alg;
wpa_printf(MSG_DEBUG, "Overriding auth_alg selection: 0x%x",
params.auth_alg);
wpa_dbg(wpa_s, MSG_DEBUG, "Overriding auth_alg selection: "
"0x%x", params.auth_alg);
}
for (i = 0; i < NUM_WEP_KEYS; i++) {
@ -121,8 +121,8 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
if (wpa_supplicant_set_suites(wpa_s, bss, ssid,
wpa_s->sme.assoc_req_ie,
&wpa_s->sme.assoc_req_ie_len)) {
wpa_printf(MSG_WARNING, "SME: Failed to set WPA key "
"management and encryption suites");
wpa_msg(wpa_s, MSG_WARNING, "SME: Failed to set WPA "
"key management and encryption suites");
return;
}
} else if (ssid->key_mgmt &
@ -134,9 +134,9 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
if (wpa_supplicant_set_suites(wpa_s, NULL, ssid,
wpa_s->sme.assoc_req_ie,
&wpa_s->sme.assoc_req_ie_len)) {
wpa_printf(MSG_WARNING, "SME: Failed to set WPA key "
"management and encryption suites (no scan "
"results)");
wpa_msg(wpa_s, MSG_WARNING, "SME: Failed to set WPA "
"key management and encryption suites (no "
"scan results)");
return;
}
#ifdef CONFIG_WPS
@ -187,7 +187,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
if (wpa_s->sme.ft_used &&
os_memcmp(md, wpa_s->sme.mobility_domain, 2) == 0 &&
wpa_sm_has_ptk(wpa_s->wpa)) {
wpa_printf(MSG_DEBUG, "SME: Trying to use FT "
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Trying to use FT "
"over-the-air");
params.auth_alg = WPA_AUTH_ALG_FT;
params.ie = wpa_s->sme.ft_ies;
@ -204,8 +204,8 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
if (rsn && wpa_parse_wpa_ie(rsn, 2 + rsn[1], &_ie) == 0 &&
_ie.capabilities &
(WPA_CAPABILITY_MFPC | WPA_CAPABILITY_MFPR)) {
wpa_printf(MSG_DEBUG, "WPA: Selected AP supports MFP: "
"require MFP");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Selected AP supports "
"MFP: require MFP");
wpa_s->sme.mfp = MGMT_FRAME_PROTECTION_REQUIRED;
}
}
@ -229,7 +229,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
wpa_supplicant_cancel_scan(wpa_s);
wpa_msg(wpa_s, MSG_INFO, "Trying to authenticate with " MACSTR
wpa_msg(wpa_s, MSG_INFO, "SME: Trying to authenticate with " MACSTR
" (SSID='%s' freq=%d MHz)", MAC2STR(params.bssid),
wpa_ssid_txt(params.ssid, params.ssid_len), params.freq);
@ -244,7 +244,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
wpa_s->sme.auth_alg = params.auth_alg;
if (wpa_drv_authenticate(wpa_s, &params) < 0) {
wpa_msg(wpa_s, MSG_INFO, "Authentication request to the "
wpa_msg(wpa_s, MSG_INFO, "SME: Authentication request to the "
"driver failed");
wpa_supplicant_req_scan(wpa_s, 1, 0);
return;
@ -264,25 +264,25 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
struct wpa_ssid *ssid = wpa_s->current_ssid;
if (ssid == NULL) {
wpa_printf(MSG_DEBUG, "SME: Ignore authentication event when "
"network is not selected");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Ignore authentication event "
"when network is not selected");
return;
}
if (wpa_s->wpa_state != WPA_AUTHENTICATING) {
wpa_printf(MSG_DEBUG, "SME: Ignore authentication event when "
"not in authenticating state");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Ignore authentication event "
"when not in authenticating state");
return;
}
if (os_memcmp(wpa_s->pending_bssid, data->auth.peer, ETH_ALEN) != 0) {
wpa_printf(MSG_DEBUG, "SME: Ignore authentication with "
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Ignore authentication with "
"unexpected peer " MACSTR,
MAC2STR(data->auth.peer));
return;
}
wpa_printf(MSG_DEBUG, "SME: Authentication response: peer=" MACSTR
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Authentication response: peer=" MACSTR
" auth_type=%d status_code=%d",
MAC2STR(data->auth.peer), data->auth.auth_type,
data->auth.status_code);
@ -290,7 +290,7 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
data->auth.ies, data->auth.ies_len);
if (data->auth.status_code != WLAN_STATUS_SUCCESS) {
wpa_printf(MSG_DEBUG, "SME: Authentication failed (status "
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Authentication failed (status "
"code %d)", data->auth.status_code);
if (data->auth.status_code !=
@ -305,7 +305,7 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
case WLAN_AUTH_OPEN:
wpa_s->current_ssid->auth_alg = WPA_AUTH_ALG_SHARED;
wpa_printf(MSG_DEBUG, "SME: Trying SHARED auth");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Trying SHARED auth");
wpa_supplicant_associate(wpa_s, wpa_s->current_bss,
wpa_s->current_ssid);
return;
@ -313,7 +313,7 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
case WLAN_AUTH_SHARED_KEY:
wpa_s->current_ssid->auth_alg = WPA_AUTH_ALG_LEAP;
wpa_printf(MSG_DEBUG, "SME: Trying LEAP auth");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Trying LEAP auth");
wpa_supplicant_associate(wpa_s, wpa_s->current_bss,
wpa_s->current_ssid);
return;
@ -376,7 +376,7 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
if (params.wpa_ie == NULL ||
ieee802_11_parse_elems(params.wpa_ie, params.wpa_ie_len, &elems, 0)
< 0) {
wpa_printf(MSG_DEBUG, "SME: Could not parse own IEs?!");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Could not parse own IEs?!");
os_memset(&elems, 0, sizeof(elems));
}
if (elems.rsn_ie)
@ -397,8 +397,8 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
params.uapsd = -1;
if (wpa_drv_associate(wpa_s, &params) < 0) {
wpa_msg(wpa_s, MSG_INFO, "Association request to the driver "
"failed");
wpa_msg(wpa_s, MSG_INFO, "SME: Association request to the "
"driver failed");
wpas_connection_failed(wpa_s, wpa_s->pending_bssid);
os_memset(wpa_s->pending_bssid, 0, ETH_ALEN);
return;
@ -412,7 +412,7 @@ int sme_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
const u8 *ies, size_t ies_len)
{
if (md == NULL || ies == NULL) {
wpa_printf(MSG_DEBUG, "SME: Remove mobility domain");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Remove mobility domain");
os_free(wpa_s->sme.ft_ies);
wpa_s->sme.ft_ies = NULL;
wpa_s->sme.ft_ies_len = 0;
@ -437,7 +437,7 @@ void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
{
int bssid_changed;
wpa_printf(MSG_DEBUG, "SME: Association with " MACSTR " failed: "
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Association with " MACSTR " failed: "
"status code %d", MAC2STR(wpa_s->pending_bssid),
data->assoc_reject.status_code);
@ -452,8 +452,8 @@ void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
*/
if (wpa_drv_deauthenticate(wpa_s, wpa_s->pending_bssid,
WLAN_REASON_DEAUTH_LEAVING) < 0) {
wpa_msg(wpa_s, MSG_INFO,
"Deauth request to the driver failed");
wpa_msg(wpa_s, MSG_INFO, "SME: Deauth request to the driver "
"failed");
}
wpa_s->sme.prev_bssid_set = 0;
@ -469,7 +469,7 @@ void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
{
wpa_printf(MSG_DEBUG, "SME: Authentication timed out");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Authentication timed out");
wpas_connection_failed(wpa_s, wpa_s->pending_bssid);
}
@ -477,7 +477,7 @@ void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
{
wpa_printf(MSG_DEBUG, "SME: Association timed out");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Association timed out");
wpas_connection_failed(wpa_s, wpa_s->pending_bssid);
wpa_supplicant_mark_disassoc(wpa_s);
}
@ -486,7 +486,7 @@ void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
void sme_event_disassoc(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
{
wpa_printf(MSG_DEBUG, "SME: Disassociation event received");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Disassociation event received");
if (wpa_s->sme.prev_bssid_set &&
!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME)) {
/*
@ -495,8 +495,8 @@ void sme_event_disassoc(struct wpa_supplicant *wpa_s,
* state. For now, force the state to be cleared to avoid
* confusing errors if we try to associate with the AP again.
*/
wpa_printf(MSG_DEBUG, "SME: Deauthenticate to clear driver "
"state");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Deauthenticate to clear "
"driver state");
wpa_drv_deauthenticate(wpa_s, wpa_s->sme.prev_bssid,
WLAN_REASON_DEAUTH_LEAVING);
}
@ -516,7 +516,7 @@ static int sme_check_sa_query_timeout(struct wpa_supplicant *wpa_s)
os_time_sub(&now, &wpa_s->sme.sa_query_start, &passed);
tu = (passed.sec * 1000000 + passed.usec) / 1024;
if (sa_query_max_timeout < tu) {
wpa_printf(MSG_DEBUG, "SME: SA Query timed out");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: SA Query timed out");
sme_stop_sa_query(wpa_s);
wpa_supplicant_deauthenticate(
wpa_s, WLAN_REASON_PREV_AUTH_NOT_VALID);
@ -531,7 +531,7 @@ static void sme_send_sa_query_req(struct wpa_supplicant *wpa_s,
const u8 *trans_id)
{
u8 req[2 + WLAN_SA_QUERY_TR_ID_LEN];
wpa_printf(MSG_DEBUG, "SME: Sending SA Query Request to "
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Sending SA Query Request to "
MACSTR, MAC2STR(wpa_s->bssid));
wpa_hexdump(MSG_DEBUG, "SME: SA Query Transaction ID",
trans_id, WLAN_SA_QUERY_TR_ID_LEN);
@ -541,7 +541,8 @@ static void sme_send_sa_query_req(struct wpa_supplicant *wpa_s,
if (wpa_drv_send_action(wpa_s, wpa_s->assoc_freq, 0, wpa_s->bssid,
wpa_s->own_addr, wpa_s->bssid,
req, sizeof(req)) < 0)
wpa_printf(MSG_INFO, "SME: Failed to send SA Query Request");
wpa_msg(wpa_s, MSG_INFO, "SME: Failed to send SA Query "
"Request");
}
@ -575,7 +576,7 @@ static void sme_sa_query_timer(void *eloop_ctx, void *timeout_ctx)
usec = (timeout % 1000) * 1024;
eloop_register_timeout(sec, usec, sme_sa_query_timer, wpa_s, NULL);
wpa_printf(MSG_DEBUG, "SME: Association SA Query attempt %d",
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Association SA Query attempt %d",
wpa_s->sme.sa_query_count);
sme_send_sa_query_req(wpa_s, trans_id);
@ -617,8 +618,8 @@ void sme_event_unprot_disconnect(struct wpa_supplicant *wpa_s, const u8 *sa,
if (wpa_s->sme.sa_query_count > 0)
return;
wpa_printf(MSG_DEBUG, "SME: Unprotected disconnect dropped - possible "
"AP/STA state mismatch - trigger SA Query");
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Unprotected disconnect dropped - "
"possible AP/STA state mismatch - trigger SA Query");
sme_start_sa_query(wpa_s);
}
@ -632,9 +633,8 @@ void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *sa,
len < 1 + WLAN_SA_QUERY_TR_ID_LEN ||
data[0] != WLAN_SA_QUERY_RESPONSE)
return;
wpa_printf(MSG_DEBUG, "SME: Received SA Query response from " MACSTR
" (trans_id %02x%02x)",
MAC2STR(sa), data[1], data[2]);
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Received SA Query response from "
MACSTR " (trans_id %02x%02x)", MAC2STR(sa), data[1], data[2]);
if (os_memcmp(sa, wpa_s->bssid, ETH_ALEN) != 0)
return;
@ -647,13 +647,13 @@ void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *sa,
}
if (i >= wpa_s->sme.sa_query_count) {
wpa_printf(MSG_DEBUG, "SME: No matching SA Query "
wpa_dbg(wpa_s, MSG_DEBUG, "SME: No matching SA Query "
"transaction identifier found");
return;
}
wpa_printf(MSG_DEBUG, "SME: Reply to pending SA Query received from "
MACSTR, MAC2STR(sa));
wpa_dbg(wpa_s, MSG_DEBUG, "SME: Reply to pending SA Query received "
"from " MACSTR, MAC2STR(sa));
sme_stop_sa_query(wpa_s);
}

View file

@ -153,13 +153,14 @@ static int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
* sending unicast and multicast packets. */
if (ssid->mode != WPAS_MODE_IBSS) {
wpa_printf(MSG_INFO, "WPA: Invalid mode %d (not IBSS/ad-hoc) "
"for WPA-None", ssid->mode);
wpa_msg(wpa_s, MSG_INFO, "WPA: Invalid mode %d (not "
"IBSS/ad-hoc) for WPA-None", ssid->mode);
return -1;
}
if (!ssid->psk_set) {
wpa_printf(MSG_INFO, "WPA: No PSK configured for WPA-None");
wpa_msg(wpa_s, MSG_INFO, "WPA: No PSK configured for "
"WPA-None");
return -1;
}
@ -177,7 +178,7 @@ static int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
alg = WPA_ALG_TKIP;
break;
default:
wpa_printf(MSG_INFO, "WPA: Invalid group cipher %d for "
wpa_msg(wpa_s, MSG_INFO, "WPA: Invalid group cipher %d for "
"WPA-None", wpa_s->group_cipher);
return -1;
}
@ -221,7 +222,7 @@ void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
(wpa_s->drv_flags & WPA_DRIVER_FLAGS_WIRED))
return;
wpa_msg(wpa_s, MSG_DEBUG, "Setting authentication timeout: %d sec "
wpa_dbg(wpa_s, MSG_DEBUG, "Setting authentication timeout: %d sec "
"%d usec", sec, usec);
eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL);
eloop_register_timeout(sec, usec, wpa_supplicant_timeout, wpa_s, NULL);
@ -238,7 +239,7 @@ void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
*/
void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s)
{
wpa_msg(wpa_s, MSG_DEBUG, "Cancelling authentication timeout");
wpa_dbg(wpa_s, MSG_DEBUG, "Cancelling authentication timeout");
eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL);
wpa_blacklist_del(wpa_s, wpa_s->bssid);
}
@ -458,7 +459,7 @@ void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr)
* client not receiving the first encrypted packets correctly.
* Skipping some of the extra key clearing steps seems to help
* in completing group key handshake more reliably. */
wpa_printf(MSG_DEBUG, "No keys have been configured - "
wpa_dbg(wpa_s, MSG_DEBUG, "No keys have been configured - "
"skip key clearing");
return;
}
@ -532,8 +533,8 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
{
enum wpa_states old_state = wpa_s->wpa_state;
wpa_printf(MSG_DEBUG, "%s: State: %s -> %s",
wpa_s->ifname, wpa_supplicant_state_txt(wpa_s->wpa_state),
wpa_dbg(wpa_s, MSG_DEBUG, "State: %s -> %s",
wpa_supplicant_state_txt(wpa_s->wpa_state),
wpa_supplicant_state_txt(state));
if (state != WPA_SCANNING)
@ -695,7 +696,7 @@ int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s)
wpa_s->reassociate = 1;
wpa_supplicant_req_scan(wpa_s, 0, 0);
}
wpa_msg(wpa_s, MSG_DEBUG, "Reconfiguration completed");
wpa_dbg(wpa_s, MSG_DEBUG, "Reconfiguration completed");
return 0;
}
@ -704,8 +705,9 @@ static void wpa_supplicant_reconfig(int sig, void *signal_ctx)
{
struct wpa_global *global = signal_ctx;
struct wpa_supplicant *wpa_s;
wpa_printf(MSG_DEBUG, "Signal %d received - reconfiguring", sig);
for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
wpa_dbg(wpa_s, MSG_DEBUG, "Signal %d received - reconfiguring",
sig);
if (wpa_supplicant_reload_configuration(wpa_s) < 0) {
wpa_supplicant_terminate_proc(global);
}
@ -772,8 +774,8 @@ static int wpa_supplicant_suites_from_ai(struct wpa_supplicant *wpa_s,
return -1;
}
wpa_printf(MSG_DEBUG, "WPA: Using WPA IE from AssocReq to set cipher "
"suites");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Using WPA IE from AssocReq to set "
"cipher suites");
if (!(ie->group_cipher & ssid->group_cipher)) {
wpa_msg(wpa_s, MSG_INFO, "WPA: Driver used disabled group "
"cipher 0x%x (mask 0x%x) - reject",
@ -840,14 +842,14 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
(ie.group_cipher & ssid->group_cipher) &&
(ie.pairwise_cipher & ssid->pairwise_cipher) &&
(ie.key_mgmt & ssid->key_mgmt)) {
wpa_msg(wpa_s, MSG_DEBUG, "RSN: using IEEE 802.11i/D9.0");
wpa_dbg(wpa_s, MSG_DEBUG, "RSN: using IEEE 802.11i/D9.0");
proto = WPA_PROTO_RSN;
} else if (bss_wpa && (ssid->proto & WPA_PROTO_WPA) &&
wpa_parse_wpa_ie(bss_wpa, 2 +bss_wpa[1], &ie) == 0 &&
(ie.group_cipher & ssid->group_cipher) &&
(ie.pairwise_cipher & ssid->pairwise_cipher) &&
(ie.key_mgmt & ssid->key_mgmt)) {
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using IEEE 802.11i/D3.0");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using IEEE 802.11i/D3.0");
proto = WPA_PROTO_WPA;
} else if (bss) {
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to select WPA/RSN");
@ -867,18 +869,18 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
ssid->ieee80211w != NO_MGMT_FRAME_PROTECTION ?
WPA_CIPHER_AES_128_CMAC : 0;
#endif /* CONFIG_IEEE80211W */
wpa_printf(MSG_DEBUG, "WPA: Set cipher suites based "
"on configuration");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Set cipher suites "
"based on configuration");
} else
proto = ie.proto;
}
wpa_printf(MSG_DEBUG, "WPA: Selected cipher suites: group %d "
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Selected cipher suites: group %d "
"pairwise %d key_mgmt %d proto %d",
ie.group_cipher, ie.pairwise_cipher, ie.key_mgmt, proto);
#ifdef CONFIG_IEEE80211W
if (ssid->ieee80211w) {
wpa_printf(MSG_DEBUG, "WPA: Selected mgmt group cipher %d",
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Selected mgmt group cipher %d",
ie.mgmt_group_cipher);
}
#endif /* CONFIG_IEEE80211W */
@ -898,34 +900,35 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
sel = ie.group_cipher & ssid->group_cipher;
if (sel & WPA_CIPHER_CCMP) {
wpa_s->group_cipher = WPA_CIPHER_CCMP;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using GTK CCMP");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using GTK CCMP");
} else if (sel & WPA_CIPHER_TKIP) {
wpa_s->group_cipher = WPA_CIPHER_TKIP;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using GTK TKIP");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using GTK TKIP");
} else if (sel & WPA_CIPHER_WEP104) {
wpa_s->group_cipher = WPA_CIPHER_WEP104;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using GTK WEP104");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using GTK WEP104");
} else if (sel & WPA_CIPHER_WEP40) {
wpa_s->group_cipher = WPA_CIPHER_WEP40;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using GTK WEP40");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using GTK WEP40");
} else {
wpa_printf(MSG_WARNING, "WPA: Failed to select group cipher.");
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to select group "
"cipher");
return -1;
}
sel = ie.pairwise_cipher & ssid->pairwise_cipher;
if (sel & WPA_CIPHER_CCMP) {
wpa_s->pairwise_cipher = WPA_CIPHER_CCMP;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using PTK CCMP");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using PTK CCMP");
} else if (sel & WPA_CIPHER_TKIP) {
wpa_s->pairwise_cipher = WPA_CIPHER_TKIP;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using PTK TKIP");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using PTK TKIP");
} else if (sel & WPA_CIPHER_NONE) {
wpa_s->pairwise_cipher = WPA_CIPHER_NONE;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using PTK NONE");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using PTK NONE");
} else {
wpa_printf(MSG_WARNING, "WPA: Failed to select pairwise "
"cipher.");
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to select pairwise "
"cipher");
return -1;
}
@ -934,33 +937,33 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_IEEE80211R
} else if (sel & WPA_KEY_MGMT_FT_IEEE8021X) {
wpa_s->key_mgmt = WPA_KEY_MGMT_FT_IEEE8021X;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT FT/802.1X");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT FT/802.1X");
} else if (sel & WPA_KEY_MGMT_FT_PSK) {
wpa_s->key_mgmt = WPA_KEY_MGMT_FT_PSK;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT FT/PSK");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT FT/PSK");
#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
} else if (sel & WPA_KEY_MGMT_IEEE8021X_SHA256) {
wpa_s->key_mgmt = WPA_KEY_MGMT_IEEE8021X_SHA256;
wpa_msg(wpa_s, MSG_DEBUG,
wpa_dbg(wpa_s, MSG_DEBUG,
"WPA: using KEY_MGMT 802.1X with SHA256");
} else if (sel & WPA_KEY_MGMT_PSK_SHA256) {
wpa_s->key_mgmt = WPA_KEY_MGMT_PSK_SHA256;
wpa_msg(wpa_s, MSG_DEBUG,
wpa_dbg(wpa_s, MSG_DEBUG,
"WPA: using KEY_MGMT PSK with SHA256");
#endif /* CONFIG_IEEE80211W */
} else if (sel & WPA_KEY_MGMT_IEEE8021X) {
wpa_s->key_mgmt = WPA_KEY_MGMT_IEEE8021X;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT 802.1X");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT 802.1X");
} else if (sel & WPA_KEY_MGMT_PSK) {
wpa_s->key_mgmt = WPA_KEY_MGMT_PSK;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT WPA-PSK");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT WPA-PSK");
} else if (sel & WPA_KEY_MGMT_WPA_NONE) {
wpa_s->key_mgmt = WPA_KEY_MGMT_WPA_NONE;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT WPA-NONE");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using KEY_MGMT WPA-NONE");
} else {
wpa_printf(MSG_WARNING, "WPA: Failed to select authenticated "
"key management type.");
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to select "
"authenticated key management type");
return -1;
}
@ -976,11 +979,11 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
sel = 0;
if (sel & WPA_CIPHER_AES_128_CMAC) {
wpa_s->mgmt_group_cipher = WPA_CIPHER_AES_128_CMAC;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: using MGMT group cipher "
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using MGMT group cipher "
"AES-128-CMAC");
} else {
wpa_s->mgmt_group_cipher = 0;
wpa_msg(wpa_s, MSG_DEBUG, "WPA: not using MGMT group cipher");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: not using MGMT group cipher");
}
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_MGMT_GROUP,
wpa_s->mgmt_group_cipher);
@ -988,7 +991,7 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_IEEE80211W */
if (wpa_sm_set_assoc_wpa_ie_default(wpa_s->wpa, wpa_ie, wpa_ie_len)) {
wpa_printf(MSG_WARNING, "WPA: Failed to generate WPA IE.");
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to generate WPA IE");
return -1;
}
@ -1028,15 +1031,15 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION) {
#ifdef CONFIG_AP
if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_AP)) {
wpa_printf(MSG_INFO, "Driver does not support AP "
wpa_msg(wpa_s, MSG_INFO, "Driver does not support AP "
"mode");
return;
}
wpa_supplicant_create_ap(wpa_s, ssid);
wpa_s->current_bss = bss;
#else /* CONFIG_AP */
wpa_printf(MSG_ERROR, "AP mode support not included in the "
"build");
wpa_msg(wpa_s, MSG_ERROR, "AP mode support not included in "
"the build");
#endif /* CONFIG_AP */
return;
}
@ -1103,11 +1106,11 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
}
}
#endif /* IEEE8021X_EAPOL */
wpa_printf(MSG_DEBUG, "Automatic auth_alg selection: 0x%x", algs);
wpa_dbg(wpa_s, MSG_DEBUG, "Automatic auth_alg selection: 0x%x", algs);
if (ssid->auth_alg) {
algs = ssid->auth_alg;
wpa_printf(MSG_DEBUG, "Overriding auth_alg selection: 0x%x",
algs);
wpa_dbg(wpa_s, MSG_DEBUG, "Overriding auth_alg selection: "
"0x%x", algs);
}
if (bss && (wpa_bss_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE) ||
@ -1127,8 +1130,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
wpa_ie_len = sizeof(wpa_ie);
if (wpa_supplicant_set_suites(wpa_s, bss, ssid,
wpa_ie, &wpa_ie_len)) {
wpa_printf(MSG_WARNING, "WPA: Failed to set WPA key "
"management and encryption suites");
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to set WPA "
"key management and encryption suites");
return;
}
} else if (ssid->key_mgmt &
@ -1139,9 +1142,9 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
wpa_ie_len = sizeof(wpa_ie);
if (wpa_supplicant_set_suites(wpa_s, NULL, ssid,
wpa_ie, &wpa_ie_len)) {
wpa_printf(MSG_WARNING, "WPA: Failed to set WPA key "
"management and encryption suites (no scan "
"results)");
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to set WPA "
"key management and encryption suites (no "
"scan results)");
return;
}
#ifdef CONFIG_WPS
@ -1187,7 +1190,7 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
wpa_s->cross_connect_disallowed =
p2p_get_cross_connect_disallowed(p2p);
wpabuf_free(p2p);
wpa_printf(MSG_DEBUG, "P2P: WLAN AP %s cross "
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: WLAN AP %s cross "
"connection",
wpa_s->cross_connect_disallowed ?
"disallows" : "allows");
@ -1277,8 +1280,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
if (rsn && wpa_parse_wpa_ie(rsn, 2 + rsn[1], &ie) == 0 &&
ie.capabilities &
(WPA_CAPABILITY_MFPC | WPA_CAPABILITY_MFPR)) {
wpa_printf(MSG_DEBUG, "WPA: Selected AP supports MFP: "
"require MFP");
wpa_dbg(wpa_s, MSG_DEBUG, "WPA: Selected AP supports "
"MFP: require MFP");
params.mgmt_frame_protection =
MGMT_FRAME_PROTECTION_REQUIRED;
}
@ -1662,15 +1665,15 @@ struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s)
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME) {
if (ieee80211_sta_get_ssid(wpa_s, ssid, &ssid_len)) {
wpa_printf(MSG_WARNING, "Could not read SSID from "
"MLME.");
wpa_msg(wpa_s, MSG_WARNING, "Could not read SSID from "
"MLME");
return NULL;
}
} else {
res = wpa_drv_get_ssid(wpa_s, ssid);
if (res < 0) {
wpa_printf(MSG_WARNING, "Could not read SSID from "
"driver.");
wpa_msg(wpa_s, MSG_WARNING, "Could not read SSID from "
"driver");
return NULL;
}
ssid_len = res;
@ -1679,7 +1682,8 @@ struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s)
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME)
os_memcpy(bssid, wpa_s->bssid, ETH_ALEN);
else if (wpa_drv_get_bssid(wpa_s, bssid) < 0) {
wpa_printf(MSG_WARNING, "Could not read BSSID from driver.");
wpa_msg(wpa_s, MSG_WARNING, "Could not read BSSID from "
"driver");
return NULL;
}
@ -1720,8 +1724,8 @@ static int wpa_supplicant_set_driver(struct wpa_supplicant *wpa_s,
return -1;
if (wpa_drivers[0] == NULL) {
wpa_printf(MSG_ERROR, "No driver interfaces build into "
"wpa_supplicant.");
wpa_msg(wpa_s, MSG_ERROR, "No driver interfaces build into "
"wpa_supplicant");
return -1;
}
@ -1753,7 +1757,7 @@ static int wpa_supplicant_set_driver(struct wpa_supplicant *wpa_s,
driver = pos + 1;
} while (pos);
wpa_printf(MSG_ERROR, "Unsupported driver '%s'.", name);
wpa_msg(wpa_s, MSG_ERROR, "Unsupported driver '%s'", name);
return -1;
}
@ -1777,7 +1781,7 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
{
struct wpa_supplicant *wpa_s = ctx;
wpa_printf(MSG_DEBUG, "RX EAPOL from " MACSTR, MAC2STR(src_addr));
wpa_dbg(wpa_s, MSG_DEBUG, "RX EAPOL from " MACSTR, MAC2STR(src_addr));
wpa_hexdump(MSG_MSGDUMP, "RX EAPOL", buf, len);
if (wpa_s->wpa_state < WPA_ASSOCIATED) {
@ -1789,8 +1793,8 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
* association information, lets queue it for processing until
* the association event is received.
*/
wpa_printf(MSG_DEBUG, "Not associated - Delay processing of "
"received EAPOL frame");
wpa_dbg(wpa_s, MSG_DEBUG, "Not associated - Delay processing "
"of received EAPOL frame");
wpabuf_free(wpa_s->pending_eapol_rx);
wpa_s->pending_eapol_rx = wpabuf_alloc_copy(buf, len);
if (wpa_s->pending_eapol_rx) {
@ -1809,7 +1813,7 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
#endif /* CONFIG_AP */
if (wpa_s->key_mgmt == WPA_KEY_MGMT_NONE) {
wpa_printf(MSG_DEBUG, "Ignored received EAPOL frame since "
wpa_dbg(wpa_s, MSG_DEBUG, "Ignored received EAPOL frame since "
"no key management is configured");
return;
}
@ -1831,8 +1835,8 @@ void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
wpa_s->eapol_received++;
if (wpa_s->countermeasures) {
wpa_printf(MSG_INFO, "WPA: Countermeasures - dropped EAPOL "
"packet");
wpa_msg(wpa_s, MSG_INFO, "WPA: Countermeasures - dropped "
"EAPOL packet");
return;
}
@ -1901,23 +1905,23 @@ int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
}
if (wpa_s->l2 && l2_packet_get_own_addr(wpa_s->l2, wpa_s->own_addr)) {
wpa_printf(MSG_ERROR, "Failed to get own L2 address");
wpa_msg(wpa_s, MSG_ERROR, "Failed to get own L2 address");
return -1;
}
wpa_printf(MSG_DEBUG, "Own MAC address: " MACSTR,
wpa_dbg(wpa_s, MSG_DEBUG, "Own MAC address: " MACSTR,
MAC2STR(wpa_s->own_addr));
if (wpa_s->bridge_ifname[0]) {
wpa_printf(MSG_DEBUG, "Receiving packets from bridge interface"
" '%s'", wpa_s->bridge_ifname);
wpa_dbg(wpa_s, MSG_DEBUG, "Receiving packets from bridge "
"interface '%s'", wpa_s->bridge_ifname);
wpa_s->l2_br = l2_packet_init(wpa_s->bridge_ifname,
wpa_s->own_addr,
ETH_P_EAPOL,
wpa_supplicant_rx_eapol, wpa_s,
0);
if (wpa_s->l2_br == NULL) {
wpa_printf(MSG_ERROR, "Failed to open l2_packet "
wpa_msg(wpa_s, MSG_ERROR, "Failed to open l2_packet "
"connection for the bridge interface '%s'",
wpa_s->bridge_ifname);
return -1;
@ -1930,7 +1934,7 @@ int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
* happen if wpa_supplicant is killed during countermeasures. */
wpa_drv_set_countermeasures(wpa_s, 0);
wpa_printf(MSG_DEBUG, "RSN: flushing PMKID list in the driver");
wpa_dbg(wpa_s, MSG_DEBUG, "RSN: flushing PMKID list in the driver");
wpa_drv_flush_pmkid(wpa_s);
wpa_s->prev_scan_ssid = WILDCARD_SSID_SCAN;
@ -2064,24 +2068,25 @@ next_driver:
const char *pos;
pos = driver ? os_strchr(driver, ',') : NULL;
if (pos) {
wpa_printf(MSG_DEBUG, "Failed to initialize driver "
"interface - try next driver wrapper");
wpa_dbg(wpa_s, MSG_DEBUG, "Failed to initialize "
"driver interface - try next driver wrapper");
driver = pos + 1;
goto next_driver;
}
wpa_printf(MSG_ERROR, "Failed to initialize driver interface");
wpa_msg(wpa_s, MSG_ERROR, "Failed to initialize driver "
"interface");
return -1;
}
if (wpa_drv_set_param(wpa_s, wpa_s->conf->driver_param) < 0) {
wpa_printf(MSG_ERROR, "Driver interface rejected "
wpa_msg(wpa_s, MSG_ERROR, "Driver interface rejected "
"driver_param '%s'", wpa_s->conf->driver_param);
return -1;
}
ifname = wpa_drv_get_ifname(wpa_s);
if (ifname && os_strcmp(ifname, wpa_s->ifname) != 0) {
wpa_printf(MSG_DEBUG, "Driver interface replaced interface "
"name with '%s'", ifname);
wpa_dbg(wpa_s, MSG_DEBUG, "Driver interface replaced "
"interface name with '%s'", ifname);
os_strlcpy(wpa_s->ifname, ifname, sizeof(wpa_s->ifname));
}
@ -2096,7 +2101,7 @@ next_driver:
if (wpa_s->conf->dot11RSNAConfigPMKLifetime &&
wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_LIFETIME,
wpa_s->conf->dot11RSNAConfigPMKLifetime)) {
wpa_printf(MSG_ERROR, "Invalid WPA parameter value for "
wpa_msg(wpa_s, MSG_ERROR, "Invalid WPA parameter value for "
"dot11RSNAConfigPMKLifetime");
return -1;
}
@ -2104,7 +2109,7 @@ next_driver:
if (wpa_s->conf->dot11RSNAConfigPMKReauthThreshold &&
wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_REAUTH_THRESHOLD,
wpa_s->conf->dot11RSNAConfigPMKReauthThreshold)) {
wpa_printf(MSG_ERROR, "Invalid WPA parameter value for "
wpa_msg(wpa_s, MSG_ERROR, "Invalid WPA parameter value for "
"dot11RSNAConfigPMKReauthThreshold");
return -1;
}
@ -2112,7 +2117,7 @@ next_driver:
if (wpa_s->conf->dot11RSNAConfigSATimeout &&
wpa_sm_set_param(wpa_s->wpa, RSNA_SA_TIMEOUT,
wpa_s->conf->dot11RSNAConfigSATimeout)) {
wpa_printf(MSG_ERROR, "Invalid WPA parameter value for "
wpa_msg(wpa_s, MSG_ERROR, "Invalid WPA parameter value for "
"dot11RSNAConfigSATimeout");
return -1;
}
@ -2135,7 +2140,7 @@ next_driver:
if (wpa_s->conf->country[0] && wpa_s->conf->country[1] &&
wpa_drv_set_country(wpa_s, wpa_s->conf->country)) {
wpa_printf(MSG_DEBUG, "Failed to set country");
wpa_dbg(wpa_s, MSG_DEBUG, "Failed to set country");
return -1;
}
@ -2165,14 +2170,14 @@ next_driver:
#ifdef CONFIG_IBSS_RSN
wpa_s->ibss_rsn = ibss_rsn_init(wpa_s);
if (!wpa_s->ibss_rsn) {
wpa_printf(MSG_DEBUG, "Failed to init IBSS RSN");
wpa_dbg(wpa_s, MSG_DEBUG, "Failed to init IBSS RSN");
return -1;
}
#endif /* CONFIG_IBSS_RSN */
#ifdef CONFIG_P2P
if (wpas_p2p_init(wpa_s->global, wpa_s) < 0) {
wpa_printf(MSG_ERROR, "Failed to init P2P");
wpa_msg(wpa_s, MSG_ERROR, "Failed to init P2P");
return -1;
}
#endif /* CONFIG_P2P */
@ -2269,7 +2274,7 @@ struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
wpa_s->next = global->ifaces;
global->ifaces = wpa_s;
wpa_printf(MSG_DEBUG, "Added interface %s", wpa_s->ifname);
wpa_dbg(wpa_s, MSG_DEBUG, "Added interface %s", wpa_s->ifname);
return wpa_s;
}
@ -2303,7 +2308,7 @@ int wpa_supplicant_remove_iface(struct wpa_global *global,
prev->next = wpa_s->next;
}
wpa_printf(MSG_DEBUG, "Removing interface %s", wpa_s->ifname);
wpa_dbg(wpa_s, MSG_DEBUG, "Removing interface %s", wpa_s->ifname);
if (global->p2p_group_formation == wpa_s)
global->p2p_group_formation = NULL;
@ -2637,8 +2642,8 @@ void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid)
*/
freqs = get_bss_freqs_in_ess(wpa_s);
if (freqs) {
wpa_printf(MSG_DEBUG, "Another BSS in this ESS has "
"been seen; try it next");
wpa_dbg(wpa_s, MSG_DEBUG, "Another BSS in this ESS "
"has been seen; try it next");
wpa_blacklist_add(wpa_s, bssid);
/*
* On the next scan, go through only the known channels