]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
compatibility with libknot's master (3.4 WIP) docs-develop-knot-chb1lt/deployments/3165
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 6 Feb 2024 07:46:34 +0000 (08:46 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 6 Feb 2024 07:47:46 +0000 (08:47 +0100)
I'm adding this as a function, as in knot-resolver 6.x we have
one more place where it is used, and I find this more readable.

lib/layer/validate.c
lib/utils.h

index 93f1d4fc6f19b0b88a539150714deee65ab7366d..17f9074001aa7bf340f2a6b9540149c7f8196465 100644 (file)
@@ -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,
index 1f30e9843c5fdeddf83b96bc98c7e7ca727f7bfd..fab13fe8249b78dbb46b526ab6205305e0dbd322 100644 (file)
@@ -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
+       );
+}
+