diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-11-09 10:54:21 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-11-13 14:37:59 +0200 |
commit | 54f4fd02dc611aecf74bb2341ba88c94caadf6ec (patch) | |
tree | 08b15aeda5051d30bcebd30e3f26ddf944f0c97e /plugins | |
parent | 0fb7d1f43b653a9057cdd35a42b4bc766655e72d (diff) | |
download | connman-54f4fd02dc611aecf74bb2341ba88c94caadf6ec.tar.gz connman-54f4fd02dc611aecf74bb2341ba88c94caadf6ec.tar.bz2 connman-54f4fd02dc611aecf74bb2341ba88c94caadf6ec.zip |
wifi: Handle D-Bus method call failure
If -ECONNABORTED is received from the gsupplicant network disconnect
callback, it's an indication that the interface has already been
removed from wpa_supplicant side. This can happen due to a race condition
between rtnl and wpa_supplicant interface removal when a USB WiFi dongle
is pulled out.
The pointers given to the callback can no longer be trusted, don't touch
them in the callback. The have been removed by other code at this point.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/wifi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c index d2ab3b0d..1e9d28c9 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -1238,6 +1238,14 @@ static void disconnect_callback(int result, GSupplicantInterface *interface, { struct wifi_data *wifi = user_data; + DBG("result %d supplicant interface %p wifi %p", + result, interface, wifi); + + if (result == -ECONNABORTED) { + DBG("wifi interface no longer available"); + return; + } + if (wifi->network != NULL) { /* * if result < 0 supplican return an error because |