WPS: Add more debug information to PBC session overlap check
This commit is contained in:
parent
0439b08d3d
commit
f2b3c6bc9c
1 changed files with 24 additions and 7 deletions
|
@ -346,23 +346,40 @@ int wps_registrar_pbc_overlap(struct wps_registrar *reg,
|
||||||
|
|
||||||
os_get_time(&now);
|
os_get_time(&now);
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, "WPS: Checking active PBC sessions for overlap");
|
||||||
|
|
||||||
|
if (uuid_e) {
|
||||||
|
wpa_printf(MSG_DEBUG, "WPS: Add one for the requested UUID");
|
||||||
|
wpa_hexdump(MSG_DEBUG, "WPS: Requested UUID",
|
||||||
|
uuid_e, WPS_UUID_LEN);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
for (pbc = reg->pbc_sessions; pbc; pbc = pbc->next) {
|
for (pbc = reg->pbc_sessions; pbc; pbc = pbc->next) {
|
||||||
if (now.sec > pbc->timestamp.sec + WPS_PBC_WALK_TIME)
|
wpa_printf(MSG_DEBUG, "WPS: Consider PBC session with " MACSTR,
|
||||||
|
MAC2STR(pbc->addr));
|
||||||
|
wpa_hexdump(MSG_DEBUG, "WPS: UUID-E",
|
||||||
|
pbc->uuid_e, WPS_UUID_LEN);
|
||||||
|
if (now.sec > pbc->timestamp.sec + WPS_PBC_WALK_TIME) {
|
||||||
|
wpa_printf(MSG_DEBUG, "WPS: PBC walk time has "
|
||||||
|
"expired");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (first &&
|
if (first &&
|
||||||
os_memcmp(pbc->uuid_e, first->uuid_e, WPS_UUID_LEN) == 0)
|
os_memcmp(pbc->uuid_e, first->uuid_e, WPS_UUID_LEN) == 0) {
|
||||||
|
wpa_printf(MSG_DEBUG, "WPS: Same Enrollee");
|
||||||
continue; /* same Enrollee */
|
continue; /* same Enrollee */
|
||||||
|
}
|
||||||
if (uuid_e == NULL ||
|
if (uuid_e == NULL ||
|
||||||
os_memcmp(uuid_e, pbc->uuid_e, WPS_UUID_LEN))
|
os_memcmp(uuid_e, pbc->uuid_e, WPS_UUID_LEN)) {
|
||||||
|
wpa_printf(MSG_DEBUG, "WPS: New Enrollee");
|
||||||
count++;
|
count++;
|
||||||
|
}
|
||||||
if (first == NULL)
|
if (first == NULL)
|
||||||
first = pbc;
|
first = pbc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uuid_e &&
|
wpa_printf(MSG_DEBUG, "WPS: %u active PBC session(s) found", count);
|
||||||
(first == NULL ||
|
|
||||||
os_memcmp(uuid_e, first->uuid_e, WPS_UUID_LEN) != 0))
|
|
||||||
count++;
|
|
||||||
|
|
||||||
return count > 1 ? 1 : 0;
|
return count > 1 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue