From 495e4684729e7dd35b92524246d155b5f852cffe Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 24 Mar 2010 13:04:54 +0100 Subject: 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. --- src/device.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/device.c') 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; -- cgit v1.2.3