From: Samuel Ortiz Date: Wed, 24 Mar 2010 12:04:54 +0000 (+0100) Subject: Enable/Disable device when toggling the powered state X-Git-Tag: 2.0_alpha~2811 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=495e4684729e7dd35b92524246d155b5f852cffe;p=framework%2Fconnectivity%2Fconnman.git 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. --- diff --git a/src/device.c b/src/device.c index 6aeed01..2a8e7da 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;