]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Update ldns_is_rrset() to take into account TTL and do case insensitive comparison...
author[Thomas Green] <thomas.green@afnic.fr>
Wed, 4 Sep 2024 13:32:09 +0000 (15:32 +0200)
committer[Thomas Green] <thomas.green@afnic.fr>
Wed, 4 Sep 2024 13:33:28 +0000 (15:33 +0200)
rr.c

diff --git a/rr.c b/rr.c
index 95d07d31c75b81962d344f5f1244721e2e0779b7..1a9d62afa439dc82d0a987e2e6eb14d16a57f05f 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -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;
@@ -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 */
@@ -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;
                }
        }