Disconnect network before joining new network
authorMartin Xu <martin.xu@intel.com>
Thu, 9 Jul 2009 04:38:15 +0000 (12:38 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 9 Jul 2009 05:34:12 +0000 (22:34 -0700)
src/device.c

index ec28eb0..e50e9f0 100644 (file)
@@ -637,6 +637,9 @@ static DBusMessage *join_network(DBusConnection *conn,
 
        connman_network_set_protocol(network, CONNMAN_NETWORK_PROTOCOL_IP);
 
+       if (connman_device_get_disconnected(device) == FALSE)
+               __connman_device_disconnect(device);
+
        err = device->driver->join(device, network);
 
        connman_network_unref(network);