From 3bf395bd204848a6e9ecbf08194a8ec8337af599 Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Fri, 2 Feb 2024 00:15:49 +0800 Subject: [PATCH] cache-size: fix cache size value issue. --- src/dns_conf.c | 2 +- src/lib/conf.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/dns_conf.c b/src/dns_conf.c index b37dbfd54c..ab442373f7 100644 --- a/src/dns_conf.c +++ b/src/dns_conf.c @@ -5936,7 +5936,7 @@ static struct config_item _config_item[] = { CONF_CUSTOM("nftset-no-speed", _config_nftset_no_speed, NULL), CONF_CUSTOM("speed-check-mode", _config_speed_check_mode, NULL), CONF_INT("tcp-idle-time", &dns_conf_tcp_idle_time, 0, 3600), - CONF_SSIZE("cache-size", &dns_conf_cachesize, 0, CONF_INT_MAX), + CONF_SSIZE("cache-size", &dns_conf_cachesize, -1, CONF_INT_MAX), CONF_CUSTOM("cache-file", _config_option_parser_filepath, (char *)&dns_conf_cache_file), CONF_YESNO("cache-persist", &dns_conf_cache_persist), CONF_INT("cache-checkpoint-time", &dns_conf_cache_checkpoint_time, 0, 3600 * 24 * 7), diff --git a/src/lib/conf.c b/src/lib/conf.c index 549ac7d7d7..334ab9931c 100644 --- a/src/lib/conf.c +++ b/src/lib/conf.c @@ -233,10 +233,6 @@ int conf_ssize(const char *item, void *data, int argc, char *argv[]) } num = atoi(value); - if (num < 0) { - return -1; - } - size = num * base; if (size > item_size->max) { size = item_size->max;