3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

p2p: Fix Device Address updates from Probe Requests

p2p_peer_update_existing may be called with a scan_bss struct built from
a Probe Request frame so it can't access bss->p2p_probe_resp_info even
if peer->bss was built from a Probe Response.  Check the source frame
type of the scan_bss struct before updating the Device Address.

This fixes one timing issue that would make the autotest fail often.
This commit is contained in:
Andrew Zaborowski 2022-03-30 19:33:57 +02:00 committed by Denis Kenzior
parent 6f7743426b
commit ce94013bae

View File

@ -3655,11 +3655,15 @@ static bool p2p_peer_update_existing(struct scan_bss *bss,
* Some property changes may need to be notified here.
*/
if (peer->device_addr == peer->bss->addr)
peer->device_addr = bss->addr;
else
if (bss->source_frame == SCAN_BSS_PROBE_RESP)
peer->device_addr =
bss->p2p_probe_resp_info->device_info.device_addr;
else if (bss->source_frame == SCAN_BSS_PROBE_REQ && !l_memeqzero(
bss->p2p_probe_req_info->device_info.device_addr, 6))
peer->device_addr =
bss->p2p_probe_req_info->device_info.device_addr;
else
peer->device_addr = bss->addr;
scan_bss_free(peer->bss);
peer->bss = bss;