summaryrefslogtreecommitdiff
path: root/ubus.c
diff options
context:
space:
mode:
authorNathan Hintz <nlhintz@hotmail.com>2013-01-05 18:41:45 -0800
committerFelix Fietkau <nbd@openwrt.org>2013-01-06 04:09:24 +0100
commit16e21f6b33c40895cda27af4bc9f3bd0136d2482 (patch)
tree39c42058e67284c5dca4c9d7e48b280ef6928e6c /ubus.c
parent4108e7610019d63db6540de760feecf38c8b84dc (diff)
downloadnetifd-16e21f6b33c40895cda27af4bc9f3bd0136d2482.tar.gz
fix removal of unknown device
Netifd will crash if an attempt is made to remove a device that is not known to netifd. For instance: ubus call network.interface.lan remove_device "{ \"name\": \"xxx\" }" Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ubus.c b/ubus.c
index d6d4188..2b92c78 100644
--- a/ubus.c
+++ b/ubus.c
@@ -592,7 +592,7 @@ netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
device_lock();
dev = device_get(blobmsg_data(tb[DEV_NAME]), add ? 2 : 0);
- if (add && !dev) {
+ if (!dev) {
ret = UBUS_STATUS_NOT_FOUND;
goto out;
}