X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=libubus-obj.c;h=47bdb0a4e758683a4c044b4e56dfa1968b8d4acc;hp=212c13cbc9723a52c7bf438c5b67038412374bd1;hb=6280cbaf0966928c4f83b925fb5b94c3ecb1936e;hpb=a9ee3ef0cf20d8a7a807d46db4dfa48e072cca51 diff --git a/libubus-obj.c b/libubus-obj.c index 212c13c..47bdb0a 100644 --- a/libubus-obj.c +++ b/libubus-obj.c @@ -46,7 +46,9 @@ static void ubus_process_invoke(struct ubus_context *ctx, struct ubus_msghdr *hdr, struct ubus_object *obj, struct blob_attr **attrbuf) { - struct ubus_request_data req = {}; + struct ubus_request_data req = { + .fd = -1, + }; int method; int ret; bool no_reply = false; @@ -144,8 +146,12 @@ static void ubus_push_method_data(const struct ubus_method *m) mtbl = blobmsg_open_table(&b, m->name); - for (i = 0; i < m->n_policy; i++) + for (i = 0; i < m->n_policy; i++) { + if (m->mask && !(m->mask & (1 << i))) + continue; + blobmsg_add_u32(&b, m->policy[i].name, m->policy[i].type); + } blobmsg_close_table(&b, mtbl); }