From: Jukka Rissanen Date: Thu, 25 Jul 2013 13:31:27 +0000 (+0300) Subject: gsupplicant: Only add interface when wpa_supplicant is in ready state X-Git-Tag: accepted/tizen/20130912.082351~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb057ae7cf1cb028af07ee5a17127e86bcf4a12c;p=platform%2Fupstream%2Fconnman.git gsupplicant: Only add interface when wpa_supplicant is in ready state I noticed following scenario: - hardblock the device - turn on offline mode - turn off hardblock, as offline mode is still on connman will set softblock on - wpa_supplicant generated these state signals in this order: 1. INACTIVE 2. DISABLED - wifi.c cannot handle these events because the wifi pointer is NULL at this point - gsupplicant will then call wifi.c:interface_added(), this will cause the scanning to start but that will fail because we are still in softblocked state (wpa_supplicant returns error) - wifi.c goes now to forever loop i.e., it tries to start scan constantly. Only way to recover is to unblock wifi by turning offline mode off. The fix to this issue is simple, if the interface is not yet ready then gsupplicant will not call wifi.c:interface_added() callback as that is useless anyway. Upstream commit id:70445458847721186622677e2810febbf2f2f454 --- diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index db13ed6..a660b8d 100644 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -1729,7 +1729,9 @@ static void interface_property(const char *key, DBusMessageIter *iter, debug_strvalmap("Mode capability", mode_capa_map, interface->mode_capa); - callback_interface_added(interface); + if (interface->ready) + callback_interface_added(interface); + return; }