wireless: print the active configuration in status info
[project/netifd.git] / wireless.c
index 481a600..c9443bd 100644 (file)
@@ -51,9 +51,9 @@ static const struct uci_blob_param_list vif_param = {
 static void
 put_container(struct blob_buf *buf, struct blob_attr *attr, const char *name)
 {
-       void *c = blobmsg_open_table(&b, name);
-       blob_put_raw(&b, blob_data(attr), blob_len(attr));
-       blobmsg_close_table(&b, c);
+       void *c = blobmsg_open_table(buf, name);
+       blob_put_raw(buf, blob_data(attr), blob_len(attr));
+       blobmsg_close_table(buf, c);
 }
 
 static void
@@ -691,8 +691,7 @@ wireless_interface_status(struct wireless_interface *iface, struct blob_buf *b)
                blobmsg_add_string(b, "section", iface->section);
        if (iface->ifname)
                blobmsg_add_string(b, "ifname", iface->ifname);
-       if (iface->data)
-               blob_put_raw(b, blob_data(iface->data), blob_len(iface->data));
+       put_container(b, iface->config, "config");
        blobmsg_close_table(b, i);
 }
 
@@ -707,6 +706,7 @@ wireless_device_status(struct wireless_device *wdev, struct blob_buf *b)
        blobmsg_add_u8(b, "pending", wdev->state == IFS_SETUP || wdev->state == IFS_TEARDOWN);
        blobmsg_add_u8(b, "autostart", wdev->autostart);
        blobmsg_add_u8(b, "disabled", wdev->disabled);
+       put_container(b, wdev->config, "config");
 
        i = blobmsg_open_array(b, "interfaces");
        vlist_for_each_element(&wdev->interfaces, iface, node)