summaryrefslogtreecommitdiffhomepage
path: root/ubus.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-18 20:32:00 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-18 20:32:00 +0200
commitf3074dda01b5316d3743d76998d428c25c143469 (patch)
tree0975d11d0c2dd77cfffe0ba4ecdc18c91c903240 /ubus.c
parent6dfd44e127c153e721a398f22b510be1a5e9d0b0 (diff)
display device and l3_device separately in ubus status
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/ubus.c b/ubus.c
index c47f459..9b0f515 100644
--- a/ubus.c
+++ b/ubus.c
@@ -199,24 +199,11 @@ netifd_handle_status(struct ubus_context *ctx, struct ubus_object *obj,
if (iface->state == IFS_UP) {
time_t cur = system_get_rtime();
blobmsg_add_u32(&b, "uptime", cur - iface->start_time);
+ blobmsg_add_string(&b, "l3_device", iface->l3_dev->dev->ifname);
}
- if (iface->main_dev.dev) {
- struct device *dev = iface->main_dev.dev;
- const char *field;
- void *devinfo;
-
- /* use a different field for virtual devices */
- if (dev->avl.key)
- field = "device";
- else
- field = "link";
-
- devinfo = blobmsg_open_table(&b, field);
- blobmsg_add_string(&b, "name", dev->ifname);
-
- blobmsg_close_table(&b, devinfo);
- }
+ if (!(iface->proto_handler->flags & PROTO_FLAG_NODEV))
+ blobmsg_add_string(&b, "device", iface->main_dev.dev->ifname);
if (!list_is_empty(&iface->errors))
netifd_add_interface_errors(&b, iface);