mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
P2P: Refrain from performing extended listen during P2P connection
Do not perform extended listen period operations when either a P2P connection is in progress. This makes the connection more robust should an extended listen timer trigger during such an operation. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
8d0dd4eebc
commit
0f1034e388
@ -3849,6 +3849,13 @@ static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx)
|
|||||||
p2p_ext_listen_timeout, p2p, NULL);
|
p2p_ext_listen_timeout, p2p, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p2p->cfg->is_p2p_in_progress &&
|
||||||
|
p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) {
|
||||||
|
p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)",
|
||||||
|
p2p_state_txt(p2p->state));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (p2p->state == P2P_LISTEN_ONLY && p2p->ext_listen_only) {
|
if (p2p->state == P2P_LISTEN_ONLY && p2p->ext_listen_only) {
|
||||||
/*
|
/*
|
||||||
* This should not really happen, but it looks like the Listen
|
* This should not really happen, but it looks like the Listen
|
||||||
|
@ -805,6 +805,14 @@ struct p2p_config {
|
|||||||
* or 0 if not.
|
* or 0 if not.
|
||||||
*/
|
*/
|
||||||
int (*is_concurrent_session_active)(void *ctx);
|
int (*is_concurrent_session_active)(void *ctx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* is_p2p_in_progress - Check whether P2P operation is in progress
|
||||||
|
* @ctx: Callback context from cb_ctx
|
||||||
|
* Returns: 1 if P2P operation (e.g., group formation) is in progress
|
||||||
|
* or 0 if not.
|
||||||
|
*/
|
||||||
|
int (*is_p2p_in_progress)(void *ctx);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -3748,6 +3748,13 @@ static void wpas_presence_resp(void *ctx, const u8 *src, u8 status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int _wpas_p2p_in_progress(void *ctx)
|
||||||
|
{
|
||||||
|
struct wpa_supplicant *wpa_s = ctx;
|
||||||
|
return wpas_p2p_in_progress(wpa_s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wpas_p2p_init - Initialize P2P module for %wpa_supplicant
|
* wpas_p2p_init - Initialize P2P module for %wpa_supplicant
|
||||||
* @global: Pointer to global data from wpa_supplicant_init()
|
* @global: Pointer to global data from wpa_supplicant_init()
|
||||||
@ -3795,6 +3802,7 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s)
|
|||||||
p2p.go_connected = wpas_go_connected;
|
p2p.go_connected = wpas_go_connected;
|
||||||
p2p.presence_resp = wpas_presence_resp;
|
p2p.presence_resp = wpas_presence_resp;
|
||||||
p2p.is_concurrent_session_active = wpas_is_concurrent_session_active;
|
p2p.is_concurrent_session_active = wpas_is_concurrent_session_active;
|
||||||
|
p2p.is_p2p_in_progress = _wpas_p2p_in_progress;
|
||||||
|
|
||||||
os_memcpy(wpa_s->global->p2p_dev_addr, wpa_s->own_addr, ETH_ALEN);
|
os_memcpy(wpa_s->global->p2p_dev_addr, wpa_s->own_addr, ETH_ALEN);
|
||||||
os_memcpy(p2p.dev_addr, wpa_s->global->p2p_dev_addr, ETH_ALEN);
|
os_memcpy(p2p.dev_addr, wpa_s->global->p2p_dev_addr, ETH_ALEN);
|
||||||
|
Loading…
Reference in New Issue
Block a user