Parcourir la source

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>
Jouni Malinen il y a 13 ans
Parent
commit
4c2c675173
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      wpa_supplicant/p2p_supplicant.c

+ 3 - 1
wpa_supplicant/p2p_supplicant.c

@@ -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);
 }