cozybit / wpa_s_mesh_android

Other
2 stars 1 forks source link

wpa_supplicant receives SIGHUP after AMPE finishes #2

Closed twpedersen closed 10 years ago

twpedersen commented 11 years ago

This is strange. After a wpa_supplicant finishes AMPE (but never the first, ie. he connects in response to scan results), wpa_supplicant receives a SIGHUP signal (1) triggering a reconfig, which the mesh code currently can't handle cleanly and segfaults shortly after. We "fix" this with the following hack:

--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -836,7 +836,15 @@ static void wpa_supplicant_reconfig(int sig, void *signal_ctx)
 {
        struct wpa_global *global = signal_ctx;
        struct wpa_supplicant *wpa_s;
+
        for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
+               if (sig == 1) {
+                       /* XXX: FIXME: ignore this signal here, happens once a mesh STA
+                        * finishes joining a secure mesh??? */
+                       wpa_dbg(wpa_s, MSG_DEBUG, "FIXME: Signal %d received - ignoring",
+                               sig);
+                       return;
+               }
jlopex commented 10 years ago

This signal was triggered because we were freeing multiple times some hostapd data structures.

This workaround is not necessary anymore.