[PATCH] Remove leftover timeouts on cleanup

Alexandru Costache alexandru.costache.100
Thu Apr 3 02:10:18 PDT 2014


Signed-off-by: Alexandru Costache <alexandru.costache.100 at gmail.com>
---
 wpa_supplicant/dbus/dbus_common.c |  3 +++
 wpa_supplicant/p2p_supplicant.c   | 14 ++++++--------
 wpa_supplicant/wpa_supplicant.c   |  1 +
 wpa_supplicant/wps_supplicant.c   |  4 ++++
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/wpa_supplicant/dbus/dbus_common.c
b/wpa_supplicant/dbus/dbus_common.c
index 6caf740..3aa5528 100644
--- a/wpa_supplicant/dbus/dbus_common.c
+++ b/wpa_supplicant/dbus/dbus_common.c
@@ -320,6 +320,9 @@ static void wpas_dbus_deinit_common(struct
wpas_dbus_priv *priv)
     if (priv->con) {
         eloop_cancel_timeout(dispatch_initial_dbus_messages,
                      priv->con, NULL);
+
+        eloop_cancel_timeout(process_timeout, priv, NULL);
+
         dbus_connection_set_watch_functions(priv->con, NULL, NULL,
                             NULL, NULL, NULL);
         dbus_connection_set_timeout_functions(priv->con, NULL, NULL,
diff --git a/wpa_supplicant/p2p_supplicant.c
b/wpa_supplicant/p2p_supplicant.c
index 303b7fe..200598b 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3902,6 +3902,11 @@ int wpas_p2p_init(struct wpa_global *global, struct
wpa_supplicant *wpa_s)
     return 0;
 }

+static void wpas_p2p_psk_failure_removal(void *eloop_ctx, void
*timeout_ctx)
+{
+    struct wpa_supplicant *wpa_s = eloop_ctx;
+    wpas_p2p_group_delete(wpa_s, P2P_GROUP_REMOVAL_PSK_FAILURE);
+}

 /**
  * wpas_p2p_deinit - Deinitialize per-interface P2P data
@@ -3923,6 +3928,7 @@ void wpas_p2p_deinit(struct wpa_supplicant *wpa_s)

     os_free(wpa_s->go_params);
     wpa_s->go_params = NULL;
+    eloop_cancel_timeout(wpas_p2p_psk_failure_removal, wpa_s, NULL);
     eloop_cancel_timeout(wpas_p2p_group_formation_timeout, wpa_s, NULL);
     eloop_cancel_timeout(wpas_p2p_join_scan, wpa_s, NULL);
     wpa_s->p2p_long_listen = 0;
@@ -6950,14 +6956,6 @@ void wpas_p2p_remove_client(struct wpa_supplicant
*wpa_s, const u8 *peer,
         wpas_p2p_remove_client_go(w, peer, iface_addr);
 }

-
-static void wpas_p2p_psk_failure_removal(void *eloop_ctx, void
*timeout_ctx)
-{
-    struct wpa_supplicant *wpa_s = eloop_ctx;
-    wpas_p2p_group_delete(wpa_s, P2P_GROUP_REMOVAL_PSK_FAILURE);
-}
-
-
 static void wpas_p2p_group_freq_conflict(void *eloop_ctx, void
*timeout_ctx)
 {
     struct wpa_supplicant *wpa_s = eloop_ctx;
diff --git a/wpa_supplicant/wpa_supplicant.c
b/wpa_supplicant/wpa_supplicant.c
index 5c6f625..f6758ba 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -493,6 +493,7 @@ static void wpa_supplicant_cleanup(struct
wpa_supplicant *wpa_s)
     wpa_s->last_scan_res = NULL;

 #ifdef CONFIG_HS20
+    eloop_cancel_timeout(hs20_continue_icon_fetch, wpa_s, NULL);
     hs20_free_osu_prov(wpa_s);
 #endif /* CONFIG_HS20 */
 }
diff --git a/wpa_supplicant/wps_supplicant.c
b/wpa_supplicant/wps_supplicant.c
index dfcc069..8e19adc 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1464,6 +1464,10 @@ void wpas_wps_deinit(struct wpa_supplicant *wpa_s)
     eloop_cancel_timeout(wpas_wps_reenable_networks_cb, wpa_s, NULL);
     wpas_wps_clear_ap_info(wpa_s);

+#ifdef CONFIG_P2P
+    eloop_cancel_timeout(wpas_p2p_pbc_overlap_cb, wpa_s, NULL);
+#endif /* CONFIG_P2P */
+
     if (wpa_s->wps == NULL)
         return;


-- 
1.8.1.4


hs20_continue_icon_fetch() seems to go in wpa_supplicant_cleanup() also,
however I have no ideea for interworking_continue_anqp(). Also, it seems
that there's no more wpas_wps_pbc_overlap_cb(), only
wpas_p2p_pbc_overlap_cb().

Thanks,
Alexandru

--047d7bb03d30e3e45604f66e7a60
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Allright, looks like the previous message didn't make =
it as it was greater than 25KB in size. Re-sending.<br><br><div><div><div>H=
i Dan,<br><br></div>Thanks for your answer! Indeed, the=20
latest git revision already had cancel_delayed_sched_scan() implemented,
 so that issue is not present in git.<br><br></div>Short off-topic question=
 for the latest revision: in ap.c line 57 there's center_chan =3D wpas_=
p2p_get_vht80_center(wpa_s,
 mode, channel); This implies that having wpa_supplicant configured with
 CONFIGURE_AP also needs CONFIGURE_P2P, otherwise build will fail. Is=20
this the intended behaviour?<br>
<br></div><div>Here's a patch with the issues you mentioned:<br><br>Fro=
m 326a95e2ea56c2862a02de3682f162c474eae8ca Mon Sep 17 00:00:00 2001<br>From=
: Alexandru Costache <<a href=3D"mailto:alexandru.costache.100 at gmail.com=
" target=3D"_blank">alexandru.costache.100 at gmail.com</a>><br>

Date: Thu, 3 Apr 2014 05:10:18 -0400<br>Subject: [PATCH] Remove leftover ti=
meouts on cleanup<br><br>Signed-off-by: Alexandru Costache <<a href=3D"m=
ailto:alexandru.costache.100 at gmail.com" target=3D"_blank">alexandru.costach=
e.100 at gmail.com</a>><br>

---<br>=A0wpa_supplicant/dbus/dbus_common.c |=A0 3 +++<br>=A0wpa_supplicant=
/p2p_supplicant.c=A0=A0 | 14 ++++++--------<br>=A0wpa_supplicant/wpa_suppli=
cant.c=A0=A0 |=A0 1 +<br>=A0wpa_supplicant/wps_supplicant.c=A0=A0 |=A0 4 ++=
++<br>=A04 files changed, 14 insertions(+), 8 deletions(-)<br>

<br>diff --git a/wpa_supplicant/dbus/dbus_common.c b/wpa_supplicant/dbus/db=
us_common.c<br>index 6caf740..3aa5528 100644<br>--- a/wpa_supplicant/dbus/d=
bus_common.c<br>+++ b/wpa_supplicant/dbus/dbus_common.c<br>@@ -320,6 +320,9=
 @@ static void wpas_dbus_deinit_common(struct wpas_dbus_priv *priv)<br>

=A0=A0=A0=A0 if (priv->con) {<br>=A0=A0=A0=A0 =A0=A0=A0 eloop_cancel_tim=
eout(dispatch_initial_dbus_messages,<br>=A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =
=A0=A0=A0 =A0=A0=A0=A0 priv->con, NULL);<br>+<br>+=A0=A0=A0 =A0=A0=A0 el=
oop_cancel_timeout(process_timeout, priv, NULL);<br>+<br>=A0=A0=A0=A0 =A0=
=A0=A0 dbus_connection_set_watch_functions(priv->con, NULL, NULL,<br>

=A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 NU=
LL, NULL, NULL);<br>=A0=A0=A0=A0 =A0=A0=A0 dbus_connection_set_timeout_func=
tions(priv->con, NULL, NULL,<br>diff --git a/wpa_supplicant/p2p_supplica=
nt.c b/wpa_supplicant/p2p_supplicant.c<br>index 303b7fe..200598b 100644<br>

--- a/wpa_supplicant/p2p_supplicant.c<br>+++ b/wpa_supplicant/p2p_supplican=
t.c<br>@@ -3902,6 +3902,11 @@ int wpas_p2p_init(struct wpa_global *global, =
struct wpa_supplicant *wpa_s)<br>=A0=A0=A0=A0 return 0;<br>=A0}<br>=A0<br>+=
static void wpas_p2p_psk_failure_removal(void *eloop_ctx, void *timeout_ctx=
)<br>

+{<br>+=A0=A0=A0 struct wpa_supplicant *wpa_s =3D eloop_ctx;<br>+=A0=A0=A0 =
wpas_p2p_group_delete(wpa_s, P2P_GROUP_REMOVAL_PSK_FAILURE);<br>+}<br>=A0<b=
r>=A0/**<br>=A0 * wpas_p2p_deinit - Deinitialize per-interface P2P data<br>=
@@ -3923,6 +3928,7 @@ void wpas_p2p_deinit(struct wpa_supplicant *wpa_s)<br=
>

=A0<br>=A0=A0=A0=A0 os_free(wpa_s->go_params);<br>=A0=A0=A0=A0 wpa_s-&gt=
;go_params =3D NULL;<br>+=A0=A0=A0 eloop_cancel_timeout(wpas_p2p_psk_failur=
e_removal, wpa_s, NULL);<br>=A0=A0=A0=A0 eloop_cancel_timeout(wpas_p2p_grou=
p_formation_timeout, wpa_s, NULL);<br>

=A0=A0=A0=A0 eloop_cancel_timeout(wpas_p2p_join_scan, wpa_s, NULL);<br>=A0=
=A0=A0=A0 wpa_s->p2p_long_listen =3D 0;<br>@@ -6950,14 +6956,6 @@ void w=
pas_p2p_remove_client(struct wpa_supplicant *wpa_s, const u8 *peer,<br>=A0=
=A0=A0=A0 =A0=A0=A0 wpas_p2p_remove_client_go(w, peer, iface_addr);<br>

=A0}<br>=A0<br>-<br>-static void wpas_p2p_psk_failure_removal(void *eloop_c=
tx, void *timeout_ctx)<br>-{<br>-=A0=A0=A0 struct wpa_supplicant *wpa_s =3D=
 eloop_ctx;<br>-=A0=A0=A0 wpas_p2p_group_delete(wpa_s, P2P_GROUP_REMOVAL_PS=
K_FAILURE);<br>

-}<br>-<br>-<br>=A0static void wpas_p2p_group_freq_conflict(void *eloop_ctx=
, void *timeout_ctx)<br>=A0{<br>=A0=A0=A0=A0 struct wpa_supplicant *wpa_s =
=3D eloop_ctx;<br>diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_suppli=
cant/wpa_supplicant.c<br>

index 5c6f625..f6758ba 100644<br>--- a/wpa_supplicant/wpa_supplicant.c<br>+=
++ b/wpa_supplicant/wpa_supplicant.c<br>@@ -493,6 +493,7 @@ static void wpa=
_supplicant_cleanup(struct wpa_supplicant *wpa_s)<br>=A0=A0=A0=A0 wpa_s-&gt=
;last_scan_res =3D NULL;<br>

=A0<br>=A0#ifdef CONFIG_HS20<br>+=A0=A0=A0 eloop_cancel_timeout(hs20_contin=
ue_icon_fetch, wpa_s, NULL);<br>=A0=A0=A0=A0 hs20_free_osu_prov(wpa_s);<br>=
=A0#endif /* CONFIG_HS20 */<br>=A0}<br>diff --git a/wpa_supplicant/wps_supp=
licant.c b/wpa_supplicant/wps_supplicant.c<br>

index dfcc069..8e19adc 100644<br>--- a/wpa_supplicant/wps_supplicant.c<br>+=
++ b/wpa_supplicant/wps_supplicant.c<br>@@ -1464,6 +1464,10 @@ void wpas_wp=
s_deinit(struct wpa_supplicant *wpa_s)<br>=A0=A0=A0=A0 eloop_cancel_timeout=
(wpas_wps_reenable_networks_cb, wpa_s, NULL);<br>

=A0=A0=A0=A0 wpas_wps_clear_ap_info(wpa_s);<br>=A0<br>+#ifdef CONFIG_P2P<br=
>+=A0=A0=A0 eloop_cancel_timeout(wpas_p2p_pbc_overlap_cb, wpa_s, NULL);<br>=
+#endif /* CONFIG_P2P */<br>+<br>=A0=A0=A0=A0 if (wpa_s->wps =3D=3D NULL=
)<br>=A0=A0=A0=A0 =A0=A0=A0 return;<div class=3D"">
<div id=3D":5k" class=3D"" tabindex=3D"0"><img class=3D"" src=3D"images/cle=
ardot.gif"></div></div><span class=3D""><font color=3D"#888888"><br>
=A0<br>-- <br>1.8.1.4<br><br><br>hs20_continue_icon_fetch() seems to go in
 wpa_supplicant_cleanup() also, however I have no ideea for=20
interworking_continue_anqp(). Also, it seems that there's no more=20
wpas_wps_pbc_overlap_cb(), only wpas_p2p_pbc_overlap_cb().<br>
<br></font></span></div><span class=3D""><font color=3D"#888888"><div>Thank=
s,<br>Alexandru</div></font></span><br></div>

--047d7bb03d30e3e45604f66e7a60--



More information about the Hostap mailing list