NLnetLabs / simdzone

Fast and standards compliant DNS zone parser
BSD 3-Clause "New" or "Revised" License
64 stars 11 forks source link

Fix handling of implicit TTLs #228

Closed k0ekk0ek closed 3 weeks ago

k0ekk0ek commented 1 month ago

This PR (still a draft because I need to add tests and discuss the extra parameter) fixes handling of implicit TTLs. The value from $TTL is used if available (propagated to $INCLUDEs too), otherwise the last stated TTL is used. There's one scenario (two actually) where TTLs must be handled differently and that is with SIG and RRSIG RRs. I've added an additional flags parameter to the callback signature so that the application can detect whether the TTL was specified implicitly or explicitly. If implicit, NSD (or any other application) might choose to fix-up the TTL after the covered RRSet has been parsed. Alternatively, NSD may choose to error out if the TTL was specified explicitly and it did not match the TTLs of the RRSet? To some extend, it depends on what is the usual way to handle mismatching TTLs. (functionality removed after internal discussion) @wcawijngaards, @wtoorop any thoughts on the chosen solution?