mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
P2P: Add more debug prints for frequency selection
This prints out get_shared_radio_freqs() results and related information from P2P operations to make debug logs more helpful for figuring out issues related to multi-channel concurrency. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
4dd3f86834
commit
217cf4991d
@ -124,7 +124,7 @@ static int wpas_p2p_stop_find_oper(struct wpa_supplicant *wpa_s);
|
||||
static int wpas_p2p_num_unused_channels(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
int *freqs;
|
||||
int num;
|
||||
int num, unused;
|
||||
|
||||
freqs = os_calloc(wpa_s->num_multichan_concurrent, sizeof(int));
|
||||
if (!freqs)
|
||||
@ -134,7 +134,9 @@ static int wpas_p2p_num_unused_channels(struct wpa_supplicant *wpa_s)
|
||||
wpa_s->num_multichan_concurrent);
|
||||
os_free(freqs);
|
||||
|
||||
return wpa_s->num_multichan_concurrent - num;
|
||||
unused = wpa_s->num_multichan_concurrent - num;
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: num_unused_channels: %d", unused);
|
||||
return unused;
|
||||
}
|
||||
|
||||
|
||||
@ -164,6 +166,8 @@ static int wpas_p2p_valid_oper_freqs(struct wpa_supplicant *wpa_s,
|
||||
|
||||
os_free(freqs);
|
||||
|
||||
dump_freq_array(wpa_s, "valid for P2P", p2p_freqs, j);
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
|
@ -4009,6 +4009,18 @@ int wpas_wpa_is_in_progress(struct wpa_supplicant *wpa_s, int include_current)
|
||||
}
|
||||
|
||||
|
||||
void dump_freq_array(struct wpa_supplicant *wpa_s, const char *title,
|
||||
int *freq_array, unsigned int len)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "Shared frequencies (len=%u): %s",
|
||||
len, title);
|
||||
for (i = 0; i < len; i++)
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "freq[%u]: %d", i, freq_array[i]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Find the operating frequencies of any of the virtual interfaces that
|
||||
* are using the same radio as the current interface.
|
||||
@ -4022,6 +4034,8 @@ int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
|
||||
int freq;
|
||||
unsigned int idx = 0, i;
|
||||
|
||||
wpa_dbg(wpa_s, MSG_DEBUG,
|
||||
"Determining shared radio frequencies (max len %u)", len);
|
||||
os_memset(freq_array, 0, sizeof(int) * len);
|
||||
|
||||
/* First add the frequency of the local interface */
|
||||
@ -4039,12 +4053,16 @@ int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
|
||||
if (freq > 0 && idx < len &&
|
||||
(idx == 0 || freq_array[0] != freq))
|
||||
freq_array[idx++] = freq;
|
||||
dump_freq_array(wpa_s, "No get_radio_name", freq_array, idx);
|
||||
return idx;
|
||||
}
|
||||
|
||||
rn = wpa_s->driver->get_radio_name(wpa_s->drv_priv);
|
||||
if (rn == NULL || rn[0] == '\0')
|
||||
if (rn == NULL || rn[0] == '\0') {
|
||||
dump_freq_array(wpa_s, "get_radio_name failed",
|
||||
freq_array, idx);
|
||||
return idx;
|
||||
}
|
||||
|
||||
for (ifs = wpa_s->global->ifaces; ifs && idx < len;
|
||||
ifs = ifs->next) {
|
||||
@ -4074,5 +4092,7 @@ int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
|
||||
if (i == idx)
|
||||
freq_array[idx++] = freq;
|
||||
}
|
||||
|
||||
dump_freq_array(wpa_s, "completed iteration", freq_array, idx);
|
||||
return idx;
|
||||
}
|
||||
|
@ -863,6 +863,8 @@ int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
|
||||
|
||||
int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
|
||||
|
||||
void dump_freq_array(struct wpa_supplicant *wpa_s, const char *title,
|
||||
int *freq_array, unsigned int len);
|
||||
int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
|
||||
int *freq_array, unsigned int len);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user