diff --git a/src/cntlr_ubus.c b/src/cntlr_ubus.c index 015179399ac07d4be89a37a403084f5cf545b42d..e28030c87eb26e69901c0dbe871d87b54abdb5a7 100644 --- a/src/cntlr_ubus.c +++ b/src/cntlr_ubus.c @@ -440,13 +440,14 @@ static int cntlr_status(struct ubus_context *ctx, struct ubus_object *obj, b = blobmsg_open_array(&bb, "radios"); list_for_each_entry(p, &n->radiolist, list) { + char macaddrstr[18] = {0}; char bssidstr[18] = {0}; void *tttt, *ttttt; struct netif_iface *fh; - hwaddr_ntoa(p->macaddr, bssidstr); + hwaddr_ntoa(p->macaddr, macaddrstr); tt = blobmsg_open_table(&bb, ""); - blobmsg_add_string(&bb, "bssid", bssidstr); + blobmsg_add_string(&bb, "macaddr", macaddrstr); /* Show current/prefered opclasses */ cntlr_status_add_opclass(&bb, &p->cur_opclass, "cur_opclass", 20); @@ -467,20 +468,22 @@ static int cntlr_status(struct ubus_context *ctx, struct ubus_object *obj, memset(bssidstr, 0, sizeof(bssidstr)); hwaddr_ntoa(fh->bssid, bssidstr); ttttt = blobmsg_open_table(&bb, ""); - blobmsg_add_string(&bb, "bssid", bssidstr); if (fh->type == NETIF_FHBSS) { + blobmsg_add_string(&bb, "bssid", bssidstr); strcpy(type, "fronthaul"); blobmsg_add_string(&bb, "ssid", fh->ssid); } else if (fh->type == NETIF_BKBSS) { + blobmsg_add_string(&bb, "bssid", bssidstr); strcpy(type, "backhaul"); blobmsg_add_string(&bb, "ssid", fh->ssid); } else if (fh->type == NETIF_BSTA) { + blobmsg_add_string(&bb, "macaddr", bssidstr); strcpy(type, "station"); } blobmsg_add_string(&bb, "type", type); if (!hwaddr_is_zero(fh->upstream_bssid)) { hwaddr_ntoa(fh->upstream_bssid, bssidstr); - blobmsg_add_string(&bb, "upstream", bssidstr); + blobmsg_add_string(&bb, "bssid", bssidstr); } blobmsg_close_table(&bb, ttttt);