diff options
| author | Felix Fietkau | 2021-11-03 14:26:40 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2021-11-03 14:26:40 +0000 |
| commit | 406fbf478e87a926944dc3a648230ad5a4b1ebbe (patch) | |
| tree | 4a24584b0e9f085ae6bb41126ead54962c7fd4c7 | |
| parent | a0740172eda65ea608a1c52bc4eef215241d44b4 (diff) | |
| download | qosify-406fbf478e87a926944dc3a648230ad5a4b1ebbe.tar.gz | |
ubus: add support for dynamically adding dns based rules
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rw-r--r-- | ubus.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -50,6 +50,7 @@ enum { CL_ADD_IPV6, CL_ADD_TCP_PORT, CL_ADD_UDP_PORT, + CL_ADD_DNS, __CL_ADD_MAX }; @@ -60,6 +61,7 @@ static const struct blobmsg_policy qosify_add_policy[__CL_ADD_MAX] = { [CL_ADD_IPV6] = { "ipv6", BLOBMSG_TYPE_ARRAY }, [CL_ADD_TCP_PORT] = { "tcp_port", BLOBMSG_TYPE_ARRAY }, [CL_ADD_UDP_PORT] = { "udp_port", BLOBMSG_TYPE_ARRAY }, + [CL_ADD_DNS] = { "dns", BLOBMSG_TYPE_ARRAY }, }; @@ -117,6 +119,10 @@ qosify_ubus_add(struct ubus_context *ctx, struct ubus_object *obj, (ret = qosify_ubus_add_array(cur, dscp, CL_MAP_UDP_PORTS) != 0)) return ret; + if ((cur = tb[CL_ADD_DNS]) != NULL && + (ret = qosify_ubus_add_array(cur, dscp, CL_MAP_DNS) != 0)) + return ret; + qosify_map_timeout = prev_timemout; return 0; |