Skip to content

Commit

Permalink
ldns-testns match wildcard qname's
Browse files Browse the repository at this point in the history
Currently only in combination with copy_query (for simulating delegations)
  • Loading branch information
wtoorop committed Jun 3, 2023
1 parent 8d67453 commit 67b9f0a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/ldns-testpkts.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,13 @@ find_match(struct entry* entries, ldns_pkt* query_pkt,
continue;
}
if(p->match_qname) {
if(!get_owner(query_pkt) || !get_owner(reply) ||
ldns_dname_compare(
get_owner(query_pkt), get_owner(reply)) != 0) {
if (!get_owner(query_pkt) || !get_owner(reply)
|| ( !p->copy_query
&& ldns_dname_compare( get_owner(query_pkt)
, get_owner(reply)))
|| ( p->copy_query
&& !ldns_dname_match_wildcard( get_owner(query_pkt)
, get_owner(reply)))) {
verbose(3, "bad qname\n");
continue;
}
Expand Down

0 comments on commit 67b9f0a

Please sign in to comment.