summaryrefslogtreecommitdiffstats
path: root/daemon/bindings
diff options
context:
space:
mode:
authorVladimír Čunát <vladimir.cunat@nic.cz>2022-02-28 09:33:25 +0100
committerVladimír Čunát <vladimir.cunat@nic.cz>2022-02-28 19:04:48 +0100
commit3e296068bab730329d4dd8708b1cf9a530b13722 (patch)
tree2abd30be5d5a46c0c4e5b9afa42f21e66b0b4db7 /daemon/bindings
parentMerge !1264: Fix defects detected by Coverity Scan (diff)
downloadknot-resolver-3e296068bab730329d4dd8708b1cf9a530b13722.tar.xz
knot-resolver-3e296068bab730329d4dd8708b1cf9a530b13722.zip
cache nit: reduce cache.max_ttl limit a bit
The new limit is over 68 years, so still completely meaningless.
Diffstat (limited to 'daemon/bindings')
-rw-r--r--daemon/bindings/cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/daemon/bindings/cache.c b/daemon/bindings/cache.c
index 3b14ed82..d3815175 100644
--- a/daemon/bindings/cache.c
+++ b/daemon/bindings/cache.c
@@ -130,10 +130,10 @@ static int cache_max_ttl(lua_State *L)
lua_error_p(L, "expected 'max_ttl(number ttl)'");
uint32_t min = cache->ttl_min;
int64_t ttl = lua_tointeger(L, 1);
- if (ttl < 1 || ttl < min || ttl > UINT32_MAX) {
+ if (ttl < 1 || ttl < min || ttl > TTL_MAX_MAX) {
lua_error_p(L,
"max_ttl must be larger than minimum TTL, and in range <1, "
- STR(UINT32_MAX) ">'");
+ STR(TTL_MAX_MAX) ">'");
}
cache->ttl_max = ttl;
}
@@ -152,10 +152,10 @@ static int cache_min_ttl(lua_State *L)
lua_error_p(L, "expected 'min_ttl(number ttl)'");
uint32_t max = cache->ttl_max;
int64_t ttl = lua_tointeger(L, 1);
- if (ttl < 0 || ttl > max || ttl > UINT32_MAX) {
+ if (ttl < 0 || ttl > max || ttl > TTL_MAX_MAX) {
lua_error_p(L,
"min_ttl must be smaller than maximum TTL, and in range <0, "
- STR(UINT32_MAX) ">'");
+ STR(TTL_MAX_MAX) ">'");
}
cache->ttl_min = ttl;
}