Skip to content

Commit 673c8d2

Browse files
committed
compatibility with libknot's master (3.4 WIP)
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.
1 parent 5b1bf03 commit 673c8d2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: lib/layer/validate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ static int rrsig_not_found(const kr_layer_t * const ctx, const knot_pkt_t * cons
676676
}
677677
/* Add one extra label to cur_top, i.e. descend one level below current zone cut */
678678
const knot_dname_t * const cut_next = rr->owner +
679-
knot_dname_prefixlen(rr->owner, next_depth - 1, NULL);
679+
kr_dname_prefixlen(rr->owner, next_depth - 1);
680680

681681
/* Spawn that DS sub-query. */
682682
struct kr_query * const next = kr_rplan_push(&req->rplan, qry, cut_next,

Diff for: lib/utils.h

+11
Original file line numberDiff line numberDiff line change
@@ -606,3 +606,14 @@ KR_EXPORT long long kr_fssize(const char *path);
606606
/** Simply return de->dname. (useful from Lua) */
607607
KR_EXPORT const char * kr_dirent_name(const struct dirent *de);
608608

609+
610+
/* trivial libknot versions compatibility */
611+
static inline size_t kr_dname_prefixlen(const uint8_t *name, unsigned nlabels)
612+
{
613+
return knot_dname_prefixlen(name, nlabels
614+
#if KNOT_VERSION_HEX < 0x030400
615+
, NULL
616+
#endif
617+
);
618+
}
619+

0 commit comments

Comments
 (0)