P2P: Fix disconnect event not to increase idle timeout

When P2P client is processing a disconnection event, make sure the P2P
idle timeout does not get increased, i.e., set a new timeout only if no
timeout is in use. wpa_state changes between DISCONNECTED and SCANNING
can generate multiple calls to wpas_p2p_notif_disconnect() and
previously this was enough to force the idle timeout never hit in
practice when in P2P client role.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2011-12-18 22:18:42 +02:00
parent 74781dfc7b
commit 4c2c675173

View file

@ -4018,7 +4018,9 @@ void wpas_p2p_notif_connected(struct wpa_supplicant *wpa_s)
void wpas_p2p_notif_disconnected(struct wpa_supplicant *wpa_s)
{
wpas_p2p_disable_cross_connect(wpa_s);
if (!wpa_s->ap_iface)
if (!wpa_s->ap_iface &&
!eloop_is_timeout_registered(wpas_p2p_group_idle_timeout,
wpa_s, NULL))
wpas_p2p_set_group_idle_timeout(wpa_s);
}