From 2c7d3929905f3d39bbfedb3120d62cdb96916c54 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 15 May 2024 14:18:48 +0200 Subject: [PATCH] Added RESINFO draft RR type enable with: --enable-rrtype-resinfo See https://datatracker.ietf.org/doc/draft-ietf-add-resolver-info --- Changelog | 3 ++- configure.ac | 17 +++++++++++++---- ldns/rr.h | 13 ++++++++----- rr.c | 7 +++++++ 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Changelog b/Changelog index bb8c7682..f17bd82f 100644 --- a/Changelog +++ b/Changelog @@ -12,7 +12,8 @@ * Fix to compile DLLs, and pick out of the lib64 dir, and include libssp-0.dll and ldns-config. * bugfix #237: Resolver uses nameserver commented out in - /etc/resolv.conf + /etc/resolv.conf. Thanks grembo. + * Added RESINFO draft rrtype. Enable with --enable-rrtype-resinfo 1.8.3 2022-08-15 * bugfix #183: Assertion failure with OPT record without rdata. diff --git a/configure.ac b/configure.ac index 9d36d8bb..fab57fbc 100644 --- a/configure.ac +++ b/configure.ac @@ -715,12 +715,12 @@ case "$enable_rrtype_doa" in no|*) ;; esac -AC_ARG_ENABLE(rrtype-amtrelay, AS_HELP_STRING([--enable-rrtype-amtrelay],[Enable draft RR type AMTRELAY.])) +AC_ARG_ENABLE(rrtype-amtrelay, AS_HELP_STRING([--disable-rrtype-amtrelay],[Disable RR type AMTRELAY.])) case "$enable_rrtype_amtrelay" in - yes) - AC_DEFINE_UNQUOTED([RRTYPE_AMTRELAY], [], [Define this to enable RR type AMTRELAY.]) + no) ;; - no|*) + yes|*) + AC_DEFINE_UNQUOTED([RRTYPE_AMTRELAY], [], [Define this to enable RR type AMTRELAY.]) ;; esac AC_ARG_ENABLE(rrtype-svcb-https, AS_HELP_STRING([--disable-rrtype-svcb-https],[Disable RR types SVCB and HTTPS.])) @@ -731,6 +731,15 @@ case "$enable_rrtype_svcb_https" in AC_DEFINE_UNQUOTED([RRTYPE_SVCB_HTTPS], [], [Define this to enable RR types SVCB and HTTPS.]) ;; esac +AC_ARG_ENABLE(rrtype-resinfo, AS_HELP_STRING([--enable-rrtype-resinfo],[Enable RR type RESINFO.])) +case "$enable_rrtype_resinfo" in + yes) + AC_DEFINE_UNQUOTED([RRTYPE_RESINFO], [], [Define this to enable RR type RESINFO.]) + ;; + no|*) + ;; +esac + if echo "$tmp_LIBS" | grep "ws2_32" >/dev/null; then if echo "$LIBSSL_LIBS" | grep "ws2_32" >/dev/null; then diff --git a/ldns/rr.h b/ldns/rr.h index 44d54121..a42ff7a6 100644 --- a/ldns/rr.h +++ b/ldns/rr.h @@ -191,9 +191,9 @@ enum ldns_enum_rr_type LDNS_RR_TYPE_CDNSKEY = 60, /* RFC 7344 */ LDNS_RR_TYPE_OPENPGPKEY = 61, /* RFC 7929 */ LDNS_RR_TYPE_CSYNC = 62, /* RFC 7477 */ - LDNS_RR_TYPE_ZONEMD = 63, /* draft-ietf-dnsop-dns-zone-digest */ - LDNS_RR_TYPE_SVCB = 64, /* draft-ietf-dnsop-svcb-https */ - LDNS_RR_TYPE_HTTPS = 65, /* draft-ietf-dnsop-svcb-https */ + LDNS_RR_TYPE_ZONEMD = 63, /* RFC 8976 */ + LDNS_RR_TYPE_SVCB = 64, /* RFC 9460 */ + LDNS_RR_TYPE_HTTPS = 65, /* RFC 9460 */ LDNS_RR_TYPE_SPF = 99, /* RFC 4408 */ @@ -225,9 +225,12 @@ enum ldns_enum_rr_type LDNS_RR_TYPE_AVC = 258, /* Cisco's DNS-AS RR, see www.dns-as.org */ LDNS_RR_TYPE_DOA = 259, /* draft-durand-doa-over-dns */ - /** draft-ietf-mboned-driad-amt-discovery **/ + /** RFC 8777 **/ LDNS_RR_TYPE_AMTRELAY = 260, + /** draft-ietf-add-resolver-info */ + LDNS_RR_TYPE_RESINFO = 261, + /** DNSSEC Trust Authorities */ LDNS_RR_TYPE_TA = 32768, /* RFC 4431, 5074, DNSSEC Lookaside Validation */ @@ -243,7 +246,7 @@ enum ldns_enum_rr_type typedef enum ldns_enum_rr_type ldns_rr_type; /* The first fields are contiguous and can be referenced instantly */ -#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON (LDNS_RR_TYPE_AMTRELAY + 1) +#define LDNS_RDATA_FIELD_DESCRIPTORS_COMMON (LDNS_RR_TYPE_RESINFO + 1) /** * Resource Record diff --git a/rr.c b/rr.c index 95ab71d3..a9582b10 100644 --- a/rr.c +++ b/rr.c @@ -2488,6 +2488,13 @@ static ldns_rr_descriptor rdata_field_descriptors[] = { #else {LDNS_RR_TYPE_NULL, "TYPE260", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }, #endif +#ifdef RRTYPE_RESINFO + /* 261 */ + {LDNS_RR_TYPE_RESINFO, "RESINFO", 1, 0, NULL, LDNS_RDF_TYPE_STR, LDNS_RR_NO_COMPRESS, 0 }, +#else +{LDNS_RR_TYPE_NULL, "TYPE261", 1, 1, type_0_wireformat, LDNS_RDF_TYPE_NONE, LDNS_RR_NO_COMPRESS, 0 }, +#endif + /* split in array, no longer contiguous */