summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-03-24 13:04:54 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-03-24 15:10:44 +0100
commit495e4684729e7dd35b92524246d155b5f852cffe (patch)
tree6678b1aae85f15d411a71f416f4d3a4a2ba8732a /src/device.c
parenta290d8f1d8363602db37271d9802571cbab9cbe0 (diff)
downloadconnman-495e4684729e7dd35b92524246d155b5f852cffe.tar.gz
connman-495e4684729e7dd35b92524246d155b5f852cffe.tar.bz2
connman-495e4684729e7dd35b92524246d155b5f852cffe.zip
Enable/Disable device when toggling the powered state
When devices are brought up and down externally (e.g. with ifconfig), connman_device_set_powered() needs to enable or disable them. If it doesnt, the device associated networks are kept alive and we're still showing them while the device is actually down.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 6aeed017..2a8e7dab 100644
--- a/src/device.c
+++ b/src/device.c
@@ -967,6 +967,11 @@ int connman_device_set_powered(struct connman_device *device,
if (device->powered == powered)
return -EALREADY;
+ if (powered == TRUE)
+ __connman_device_enable(device);
+ else
+ __connman_device_disable(device);
+
device->powered = powered;
device->powered_pending = powered;