]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix disconnect event not to increase idle timeout
authorJouni Malinen <j@w1.fi>
Sun, 18 Dec 2011 20:18:42 +0000 (22:18 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 18 Dec 2011 20:18:42 +0000 (22:18 +0200)
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>

wpa_supplicant/p2p_supplicant.c

index aedbf1098b001bf88a1d5dc62d10d060a4cf73a6..80f7afdfd5c3dd78cb3df85595d57fd13c028f82 100644 (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);
 }