summaryrefslogtreecommitdiffstats
path: root/lib/rules
diff options
context:
space:
mode:
authorVladimír Čunát <vladimir.cunat@nic.cz>2023-07-12 16:24:44 +0200
committerVladimír Čunát <vladimir.cunat@nic.cz>2023-07-12 16:24:44 +0200
commite07c13f60a1a9f89c485f0f7d200aed287e38133 (patch)
treec5e76718e6cc23ea22ae0f6e8b1478d55280effa /lib/rules
parentMerge !1423: distro/pkg/rpm: require setuptools on suse (diff)
downloadknot-resolver-e07c13f60a1a9f89c485f0f7d200aed287e38133.tar.xz
knot-resolver-e07c13f60a1a9f89c485f0f7d200aed287e38133.zip
lib/rules kr_view_insert_action(): fix subnet truncation
The rule DB keys were truncated by one byte. Unfortunately that often kept them behaving OK so it went unnoticed; but in particular any /0 views got ignored as a result.
Diffstat (limited to 'lib/rules')
-rw-r--r--lib/rules/api.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rules/api.c b/lib/rules/api.c
index 325ed77d..6abc0ac1 100644
--- a/lib/rules/api.c
+++ b/lib/rules/api.c
@@ -848,6 +848,7 @@ int kr_view_insert_action(const char *subnet, const char *action)
{ // Write ruleset-specific prefix of the key.
const size_t rsp_len = strlen(RULESET_DEFAULT);
key.data -= rsp_len;
+ key.len += rsp_len;
memcpy(key.data, RULESET_DEFAULT, rsp_len);
}