]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix dropped covers field for SIG records in dns_diff_apply
authorOndřej Surý <ondrej@isc.org>
Thu, 16 Apr 2026 09:21:48 +0000 (11:21 +0200)
committerOndřej Surý <ondrej@isc.org>
Fri, 17 Apr 2026 17:24:13 +0000 (19:24 +0200)
rdata_covers() in lib/dns/diff.c discriminated only on
dns_rdatatype_rrsig (46) and returned 0 for the legacy SIG (24), so
the covered-type field was silently discarded on the dynamic-update
and IXFR paths.  Every SIG rdataset was then filed in the zone DB
under typepair (SIG, 0) instead of (SIG, covered_type); a second SIG
add with a different covers but a different TTL collided at that
bucket, tripped DNS_DBADD_EXACTTTL in qpzone, returned
DNS_R_NOTEXACT, and came back to the client as SERVFAIL.

Use dns_rdatatype_issig() here so both SIG and RRSIG carry their
covers through the diff, matching the helper pattern already used in
lib/dns/master.c, lib/ns/xfrout.c, lib/dns/qpcache.c, and the
dns__db_findrdataset() REQUIRE that the surrounding merge request
just relaxed.

(cherry picked from commit 0a5ba57116857779680d76fe4b20e125f3bc3b71)

lib/dns/diff.c

index 0262211c28a548fe9e52c04235b956dad5eef743..5ce472cecec50abc3eee2fee80b5c6eb64467b0c 100644 (file)
 
 static dns_rdatatype_t
 rdata_covers(dns_rdata_t *rdata) {
-       return rdata->type == dns_rdatatype_rrsig ? dns_rdata_covers(rdata) : 0;
+       if (rdata->type == dns_rdatatype_rrsig ||
+           rdata->type == dns_rdatatype_sig)
+       {
+               return dns_rdata_covers(rdata);
+       }
+
+       return 0;
 }
 
 isc_result_t