diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-02-06 12:40:35 +0100 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-02-06 12:40:35 +0100 |
commit | dfab2071a3875103378dd18389e785ffa07eec7b (patch) | |
tree | f894b15dbcd5e3ac75385ef54ea22336523c9eb0 | |
parent | Merge branch 'doc-logo-manual-colors-5' into 'master' (diff) | |
parent | compatibility with libknot's master (3.4 WIP) (diff) | |
download | knot-resolver-dfab2071a3875103378dd18389e785ffa07eec7b.tar.xz knot-resolver-dfab2071a3875103378dd18389e785ffa07eec7b.zip |
Merge !1494: compatibility with libknot's master (3.4 WIP)
-rw-r--r-- | lib/layer/validate.c | 2 | ||||
-rw-r--r-- | lib/utils.h | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/layer/validate.c b/lib/layer/validate.c index 93f1d4fc..17f90740 100644 --- a/lib/layer/validate.c +++ b/lib/layer/validate.c @@ -676,7 +676,7 @@ static int rrsig_not_found(const kr_layer_t * const ctx, const knot_pkt_t * cons } /* Add one extra label to cur_top, i.e. descend one level below current zone cut */ const knot_dname_t * const cut_next = rr->owner + - knot_dname_prefixlen(rr->owner, next_depth - 1, NULL); + kr_dname_prefixlen(rr->owner, next_depth - 1); /* Spawn that DS sub-query. */ struct kr_query * const next = kr_rplan_push(&req->rplan, qry, cut_next, diff --git a/lib/utils.h b/lib/utils.h index 1f30e984..fab13fe8 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -606,3 +606,14 @@ KR_EXPORT long long kr_fssize(const char *path); /** Simply return de->dname. (useful from Lua) */ KR_EXPORT const char * kr_dirent_name(const struct dirent *de); + +/* trivial libknot versions compatibility */ +static inline size_t kr_dname_prefixlen(const uint8_t *name, unsigned nlabels) +{ + return knot_dname_prefixlen(name, nlabels + #if KNOT_VERSION_HEX < 0x030400 + , NULL + #endif + ); +} + |