diff options
author | Jose Blanquicet <blanquicet@gmail.com> | 2016-09-08 11:27:24 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2016-09-08 15:19:46 +0300 |
commit | c82fe8682b742005086fd28b8681521f09747e9f (patch) | |
tree | 7127b3650defff61edf854733d45286c44d91a5a /gsupplicant | |
parent | 1a3b17096251b0b24c1673d316cb9f7d37161e48 (diff) | |
download | connman-c82fe8682b742005086fd28b8681521f09747e9f.tar.gz |
gsupplicant: Ensure callback is called after WPS disconnection
In 7784ca7234be2b854f298f4e150ecaa5212c0301 was added a patch to not
perform "RemoveNetwork" in interface_disconnect_result() for WPS use
cases because "AddNetwork" is not done in these cases. However, the
disconnection callback is not called when there was not error
(result == 0). Therefore, flags are not clean and feature initially
introduced in 43e6e141ee352e77fdb894b918f280024785f3df to make sure
disconnection is completed before trying to connect a new network will
not work in WPS use cases.
This patch ensures disconnection callback is always called in WPS use
cases.
Reported by Eunok Lee <ogi337@gmail.com> while testing RFC for WPS
proposal.
Diffstat (limited to 'gsupplicant')
-rw-r--r-- | gsupplicant/supplicant.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 4cb533d2..0a3815de 100644 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -4952,20 +4952,24 @@ static void interface_disconnect_result(const char *error, result = -ECONNABORTED; } - if (result < 0 && data->callback) { - data->callback(result, data->interface, data->user_data); - data->callback = NULL; - } - /* If we are disconnecting from previous WPS successful * association. i.e.: it did not went through AddNetwork, * and interface->network_path was never set. */ if (!data->interface->network_path) { + if (data->callback) + data->callback(result, data->interface, + data->user_data); + g_free(data->path); dbus_free(data); return; } + if (result < 0 && data->callback) { + data->callback(result, data->interface, data->user_data); + data->callback = NULL; + } + if (result != -ECONNABORTED) { if (network_remove(data) < 0) { g_free(data->path); |