Optionally exclude ZONEMD RRs in ldns-compare-zone #220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As with
SOA
,ZONEMD
resource records may not be meaningful when comparing zones (because of the only difference may be theSOA
SERIAL
value, leading to differentZONEMD
RDATA).This pull request:
ldns_zone_new_frm_fp_l_e
to parse a zone excluding a specified RR type;-Z
option toldns-compare-zone
to exclude ZONEMD RR type from zone comparison.When setting
-Z
, the last argument toldns_zone_new_frm_fp_l_e
is set toLDNS_RR_TYPE_ZONEMD
and this record type is ignored while reading the zone from file.I know this change could have been implemented purely in
examples/ldns-compare-zones.c
(e.g. by creating a new emptyrr_list
, iterating over all the read RRs and only those with a type different from fromLDNS_RR_TYPE_ZONEMD
) but this seemed inefficient, especially for large zones.The counterpart is this solution creates an additional "core" function in
zone.c
, for the sole purpose of this additional option. If this is deemed too obtrusive, I can fallback to the other alternative.I am also aware that
ZONEMD
RRs can be filtered out usingldns-read-zone -e ZONEMD
but this doubles the amount of parsing and pipes/redirections may not always be available (e. g. while usingldns-compare-zone
in systemdExec*
directives).