Skip to content

Commit

Permalink
Update ldns_is_rrset() to take into account TTL and do case insensiti…
Browse files Browse the repository at this point in the history
…ve comparison of owner names
  • Loading branch information
tgreenx committed Sep 4, 2024
1 parent 925bbe5 commit 93f37cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,7 @@ ldns_is_rrset(const ldns_rr_list *rr_list)
{
ldns_rr_type t;
ldns_rr_class c;
uint32_t l;
ldns_rdf *o;
ldns_rr *tmp;
size_t i;
Expand All @@ -1276,6 +1277,7 @@ ldns_is_rrset(const ldns_rr_list *rr_list)

t = ldns_rr_get_type(tmp);
c = ldns_rr_get_class(tmp);
l = ldns_rr_ttl(tmp);
o = ldns_rr_owner(tmp);

/* compare these with the rest of the rr_list, start with 1 */
Expand All @@ -1287,7 +1289,10 @@ ldns_is_rrset(const ldns_rr_list *rr_list)
if (c != ldns_rr_get_class(tmp)) {
return false;
}
if (ldns_rdf_compare(o, ldns_rr_owner(tmp)) != 0) {
if (l != ldns_rr_ttl(tmp)) {
return false;
}
if (ldns_dname_compare(o, ldns_rr_owner(tmp)) != 0) {
return false;
}
}
Expand Down

0 comments on commit 93f37cf

Please sign in to comment.