summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorSam Leffler <sleffler@google.com>2009-11-30 18:26:15 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-11-30 18:29:48 +0100
commit322c62bff4462c38c6643e9850847afd4c671c08 (patch)
tree44bfcbcf294338fc70a5ec61fa435820367c410c /src/device.c
parenteafed80a48c77f3a58bb8feacc095f934b2529ac (diff)
downloadconnman-322c62bff4462c38c6643e9850847afd4c671c08.tar.gz
connman-322c62bff4462c38c6643e9850847afd4c671c08.tar.bz2
connman-322c62bff4462c38c6643e9850847afd4c671c08.zip
Add workaround for DHCP startup failures with WiFi networks
When connecting to a wireless network the supplicant plugin holds to a network object. But this object is removed from the object table as a consequence of doing a device disconnect. If a network connect is in progress when nother connect request comes in (e.g. via D-Bus) it will irst disconnect which causes the object to be yanked from the global table. When the first connect request completes the reference held by the supplicant code is "unregistered" and not usable in starting up a DHCP client. This leaves it in an unfixable state (restart required). Workaround is to check in __connman_device_disconnect whether a network is "connecting" and not disconnect it.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 9378eef0..f11ecf4c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1263,6 +1263,22 @@ int __connman_device_disconnect(struct connman_device *device)
while (g_hash_table_iter_next(&iter, &key, &value) == TRUE) {
struct connman_network *network = value;
+ if (__connman_network_get_connecting(network) == TRUE) {
+ /*
+ * Skip network in the process of connecting.
+ * This is a workaround for WiFi networks serviced
+ * by the supplicant plugin that hold a reference
+ * to the network. If we disconnect the network
+ * here then the referenced object will not be
+ * registered and usage (like launching DHCP client)
+ * will fail. There is nothing to be gained by
+ * removing the network here anyway.
+ */
+ connman_warn("Skipping disconnect of %s",
+ connman_network_get_identifier(network));
+ continue;
+ }
+
__connman_network_disconnect(network);
}