mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
P2P: Fix shared freq check and support AP mode validation
The previous commit did not use the correct pointer in all operations and was specific to station mode interfaces. Fix and extend it to work with AP/GO interfaces, too. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
4b15620609
commit
86ae2e8a42
@ -2619,15 +2619,19 @@ static int wpas_check_freq_conflict(struct wpa_supplicant *wpa_s, int freq)
|
|||||||
continue;
|
continue;
|
||||||
if (iface->current_ssid == NULL || iface->assoc_freq == 0)
|
if (iface->current_ssid == NULL || iface->assoc_freq == 0)
|
||||||
continue;
|
continue;
|
||||||
if (wpa_drv_get_bssid(iface, bssid) == 0) {
|
if (iface->current_ssid->mode == WPAS_MODE_AP ||
|
||||||
if (freq != (int) wpa_s->assoc_freq) {
|
iface->current_ssid->mode == WPAS_MODE_P2P_GO)
|
||||||
wpa_printf(MSG_DEBUG, "P2P: Frequency "
|
shared_freq = iface->current_ssid->frequency;
|
||||||
"conflict - %s connected on %d MHz "
|
else if (wpa_drv_get_bssid(iface, bssid) == 0)
|
||||||
"- new connection on %d MHz",
|
shared_freq = iface->assoc_freq;
|
||||||
wpa_s->ifname, wpa_s->assoc_freq,
|
else
|
||||||
freq);
|
shared_freq = 0;
|
||||||
return 1;
|
|
||||||
}
|
if (shared_freq && freq != shared_freq) {
|
||||||
|
wpa_printf(MSG_DEBUG, "P2P: Frequency conflict - %s "
|
||||||
|
"connected on %d MHz - new connection on "
|
||||||
|
"%d MHz", iface->ifname, shared_freq, freq);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user