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;
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);
}