From 534f7866160bcd7d398827e540a564c2636d4a71 Mon Sep 17 00:00:00 2001 From: Polynomialdivision Date: Sat, 6 Jun 2020 09:09:09 +0200 Subject: [PATCH] ubus: fix wrong parsing policy --- src/utils/ubus.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/ubus.c b/src/utils/ubus.c index bb6c4c6..40234c4 100644 --- a/src/utils/ubus.c +++ b/src/utils/ubus.c @@ -213,7 +213,6 @@ enum { CLIENT_TABLE_BANDWIDTH, CLIENT_TABLE_WEIGHT, CLIENT_TABLE_NEIGHBOR, - CLIENT_TABLE_RRM, __CLIENT_TABLE_MAX, }; @@ -230,7 +229,6 @@ static const struct blobmsg_policy client_table_policy[__CLIENT_TABLE_MAX] = { [CLIENT_TABLE_BANDWIDTH] = {.name = "bandwidth", .type = BLOBMSG_TYPE_INT32}, [CLIENT_TABLE_WEIGHT] = {.name = "ap_weight", .type = BLOBMSG_TYPE_INT32}, [CLIENT_TABLE_NEIGHBOR] = {.name = "neighbor_report", .type = BLOBMSG_TYPE_STRING}, - [CLIENT_TABLE_RRM] = {.name = "rrm", .type = BLOBMSG_TYPE_ARRAY}, }; enum { @@ -246,6 +244,7 @@ enum { CLIENT_WPS, CLIENT_MFP, CLIENT_AID, + CLIENT_RRM, __CLIENT_MAX, }; @@ -262,6 +261,7 @@ static const struct blobmsg_policy client_policy[__CLIENT_MAX] = { [CLIENT_WPS] = {.name = "wps", .type = BLOBMSG_TYPE_INT8}, [CLIENT_MFP] = {.name = "mfp", .type = BLOBMSG_TYPE_INT8}, [CLIENT_AID] = {.name = "aid", .type = BLOBMSG_TYPE_INT32}, + [CLIENT_RRM] = {.name = "rrm", .type = BLOBMSG_TYPE_ARRAY}, }; enum { @@ -938,9 +938,9 @@ dump_client(struct blob_attr **tb, uint8_t client_addr[], const char *bssid_addr client_entry.aid = blobmsg_get_u32(tb[CLIENT_AID]); } /* RRM Caps */ - if (tb[CLIENT_TABLE_RRM]) { - client_entry.rrm_enabled_capa = dump_rrm_table(blobmsg_data(tb[CLIENT_TABLE_RRM]), - blobmsg_data_len(tb[CLIENT_TABLE_RRM]));// get the first byte from rrm array + if (tb[CLIENT_RRM]) { + client_entry.rrm_enabled_capa = dump_rrm_table(blobmsg_data(tb[CLIENT_RRM]), + blobmsg_data_len(tb[CLIENT_RRM]));// get the first byte from rrm array //ap_entry.ap_weight = blobmsg_get_u32(tb[CLIENT_TABLE_RRM]); } else { client_entry.rrm_enabled_capa = 0; @@ -953,7 +953,7 @@ dump_client(struct blob_attr **tb, uint8_t client_addr[], const char *bssid_addr } else { memset(client_entry.signature, 0, 1024); - } + } insert_client_to_array(client_entry); }