From 92265e7acf0bc7b34618c40d4d7197cfc409b18e Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Mon, 7 Nov 2022 18:04:52 +0800 Subject: [PATCH] feat: `ipv6-disabled` option for dnsproxy ref issue #2 --- src/applet/dnsproxy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/applet/dnsproxy.c b/src/applet/dnsproxy.c index 4b86264..0a5dd4a 100644 --- a/src/applet/dnsproxy.c +++ b/src/applet/dnsproxy.c @@ -96,8 +96,9 @@ char* dnsproxy_config(dnsproxy *info) { // generate json configure from dnsproxy if (info->optimistic) { cJSON_AddTrueToObject(config, "cache-optimistic"); // cache-optimistic --(default)--> `false` } - // TODO: load ipv6 option - log_warn("TODO: load ipv6 option"); + if (!info->ipv6) { + cJSON_AddTrueToObject(config, "ipv6-disabled"); // ipv6-disabled --(default)--> `false` + } cJSON *port = cJSON_CreateArray(); cJSON_AddItemToArray(port, cJSON_CreateNumber(info->port));