mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-18 10:54:03 -05:00
P2P: Reject P2P_FIND and P2P_LISTEN on disabled interface
This makes the P2P operations behave more consistently with the SCAN command. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
c71c241674
commit
e9eb648e0e
@ -3933,6 +3933,11 @@ static int p2p_ctrl_find(struct wpa_supplicant *wpa_s, char *cmd)
|
|||||||
char *pos;
|
char *pos;
|
||||||
unsigned int search_delay;
|
unsigned int search_delay;
|
||||||
|
|
||||||
|
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
|
||||||
|
wpa_dbg(wpa_s, MSG_INFO,
|
||||||
|
"Reject P2P_FIND since interface is disabled");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (os_strstr(cmd, "type=social"))
|
if (os_strstr(cmd, "type=social"))
|
||||||
type = P2P_FIND_ONLY_SOCIAL;
|
type = P2P_FIND_ONLY_SOCIAL;
|
||||||
else if (os_strstr(cmd, "type=progressive"))
|
else if (os_strstr(cmd, "type=progressive"))
|
||||||
@ -4084,6 +4089,11 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd,
|
|||||||
static int p2p_ctrl_listen(struct wpa_supplicant *wpa_s, char *cmd)
|
static int p2p_ctrl_listen(struct wpa_supplicant *wpa_s, char *cmd)
|
||||||
{
|
{
|
||||||
unsigned int timeout = atoi(cmd);
|
unsigned int timeout = atoi(cmd);
|
||||||
|
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
|
||||||
|
wpa_dbg(wpa_s, MSG_INFO,
|
||||||
|
"Reject P2P_LISTEN since interface is disabled");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return wpas_p2p_listen(wpa_s, timeout);
|
return wpas_p2p_listen(wpa_s, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user