diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-01-23 14:09:43 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-01-23 14:09:43 +0100 |
commit | 5fefb43a4151ee99d4c78ebaf1807043e859021a (patch) | |
tree | 1e84215ff3e3dea71ec2594276f5df3e31dae38d /device.c | |
parent | 4bdcb2edfecd9a955d1eed9fcf8d620dbd5cebf8 (diff) |
always call device_set_disabled, even if the "enabled" attribute is not present
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -197,12 +197,11 @@ device_init_settings(struct device *dev, struct blob_attr **tb) struct device_settings *s = &dev->settings; struct blob_attr *cur; struct ether_addr *ea; + bool disabled = false; s->flags = 0; - dev->disabled = false; - if ((cur = tb[DEV_ATTR_ENABLED])) - device_set_disabled(dev, !blobmsg_get_bool(cur)); + disabled = !blobmsg_get_bool(cur); if ((cur = tb[DEV_ATTR_MTU])) { s->mtu = blobmsg_get_u32(cur); @@ -221,6 +220,8 @@ device_init_settings(struct device *dev, struct blob_attr **tb) s->flags |= DEV_OPT_MACADDR; } } + + device_set_disabled(dev, disabled); } static void __init dev_init(void) |