Skip to content

Commit

Permalink
compatibility with libknot's master (3.4 WIP)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vcunat committed Feb 6, 2024
1 parent 5b1bf03 commit 673c8d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/layer/validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 11 additions & 0 deletions lib/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

0 comments on commit 673c8d2

Please sign in to comment.