summaryrefslogtreecommitdiff
path: root/iwinfo_utils.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-10-27 17:01:38 +0100
committerJo-Philipp Wich <jow@openwrt.org>2014-10-27 17:27:52 +0100
commitc92728fbace8f539edbb393222bea6a4e8717075 (patch)
tree95c49bccf9489ef5925652e5cda3af74f58d81b5 /iwinfo_utils.c
parent149ce00582eea9a23bc0aae72f32ebc4deac6780 (diff)
downloadiwinfo-c92728fbace8f539edbb393222bea6a4e8717075.tar.gz
utils: support extended format for uci section lookup
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'iwinfo_utils.c')
-rw-r--r--iwinfo_utils.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/iwinfo_utils.c b/iwinfo_utils.c
index b313ea2..93de032 100644
--- a/iwinfo_utils.c
+++ b/iwinfo_utils.c
@@ -372,6 +372,7 @@ struct uci_section *iwinfo_uci_get_radio(const char *name, const char *type)
struct uci_ptr ptr = {
.package = "wireless",
.section = name,
+ .flags = UCI_LOOKUP_EXTENDED,
};
const char *opt;
@@ -381,11 +382,7 @@ struct uci_section *iwinfo_uci_get_radio(const char *name, const char *type)
return NULL;
}
- memset(&ptr, 0, sizeof(ptr));
- ptr.package = "wireless";
- ptr.section = name;
-
- if (uci_lookup_ptr(uci_ctx, &ptr, NULL, false))
+ if (uci_lookup_ptr(uci_ctx, &ptr, NULL, true))
return NULL;
if (!ptr.s || strcmp(ptr.s->type, "wifi-device") != 0)