From 97692acd9e00d3c57cd399fbb0980717d4033659 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 21 Nov 2016 15:05:07 +0100 Subject: [PATCH] ubus: Use device_find to find a device when displaying device info Replace device_get by device_find in netifd_dev_status as device_get will fail to find the device if it's created via config as an aliased vlan device in dotted notation (eg @iface.200). In such case get_vlan_device_chain will figure out the layer3 device but get_vlan_device will not find the vlan device in the dependency list of the layer 3 device as it has been created as a dependency of the aliased device. Signed-off-by: Hans Dedecker --- ubus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubus.c b/ubus.c index 4d43b57..8ba43c0 100644 --- a/ubus.c +++ b/ubus.c @@ -204,7 +204,7 @@ netifd_dev_status(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_parse(dev_policy, __DEV_MAX, tb, blob_data(msg), blob_len(msg)); if (tb[DEV_NAME]) { - dev = device_get(blobmsg_data(tb[DEV_NAME]), false); + dev = device_find(blobmsg_data(tb[DEV_NAME])); if (!dev) return UBUS_STATUS_INVALID_ARGUMENT; } -- 2.11.0