Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally exclude ZONEMD RRs in ldns-compare-zone #220

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

gjherbiet
Copy link

As with SOA, ZONEMD resource records may not be meaningful when comparing zones (because of the only difference may be the SOA SERIAL value, leading to different ZONEMD RDATA).

This pull request:

  • defines a new function ldns_zone_new_frm_fp_l_e to parse a zone excluding a specified RR type;
  • adds a new -Z option to ldns-compare-zone to exclude ZONEMD RR type from zone comparison.

When setting -Z, the last argument to ldns_zone_new_frm_fp_l_e is set to LDNS_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 empty rr_list, iterating over all the read RRs and only those with a type different from from LDNS_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 using ldns-read-zone -e ZONEMD but this doubles the amount of parsing and pipes/redirections may not always be available (e. g. while using ldns-compare-zone in systemd Exec* directives).

* define a new function `ldns_zone_new_frm_fp_l_e` to parse a zone excluding a
  specified RR type;
* add a new `-Z` option to `ldns-compare-zone` to exclude ZONEMD RR type from
  zone comparison.
@wtoorop
Copy link
Member

wtoorop commented Jul 12, 2024

Thanks @gjherbiet good feature, but I don't really like the introduction of the new function (as it is very specific).
Could you perhaps make it so that ZONEMD will be removed from the zone files (when requested with -Z) in ldns-compare-zone.c?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants