summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-01-23 14:09:43 +0100
committerFelix Fietkau <nbd@openwrt.org>2012-01-23 14:09:43 +0100
commit5fefb43a4151ee99d4c78ebaf1807043e859021a (patch)
tree1e84215ff3e3dea71ec2594276f5df3e31dae38d /device.c
parent4bdcb2edfecd9a955d1eed9fcf8d620dbd5cebf8 (diff)
always call device_set_disabled, even if the "enabled" attribute is not present
Diffstat (limited to 'device.c')
-rw-r--r--device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/device.c b/device.c
index 84e6528..d47bcdf 100644
--- a/device.c
+++ b/device.c
@@ -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)