device: Reset device->connections and device->scanning on device enable
authorMohamed Abbas <mabbas@linux.intel.com>
Thu, 9 Dec 2010 00:37:16 +0000 (16:37 -0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 13 Dec 2010 16:06:18 +0000 (17:06 +0100)
Make sure we reset these value since the device just enabled.

src/device.c

index f2b8cf2..957be7c 100644 (file)
@@ -200,6 +200,9 @@ int __connman_device_enable(struct connman_device *device)
        if (device->blocked == TRUE)
                return -ENOLINK;
 
+       connman_device_set_disconnected(device, FALSE);
+       device->scanning = FALSE;
+
        err = device->driver->enable(device);
        if (err < 0 && err != -EALREADY) {
                if (err == -EINPROGRESS) {