From a6076ee7c16ea5cdd3d3618573bc9d3642f99c27 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 4 Dec 2024 13:02:13 +1100 Subject: [PATCH] Use UPDATE-LEASE instead of UL in output for EDNS UL The offical EDNS option name "UL" is "UPDATE-LEASE". Emit "UPDATE-LEASE" instead of "UL" but keep "UL" as an alias on the command line. --- bin/dig/dighost.c | 1 + bin/tests/system/digdelv/tests.sh | 26 +++++++++++++------------- lib/dns/message.c | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 69a310d2f3..2d68412d55 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -1378,6 +1378,7 @@ typedef struct dig_ednsoptname { dig_ednsoptname_t optnames[] = { { 1, "LLQ" }, /* draft-sekar-dns-llq */ + { 2, "UPDATE-LEASE" }, /* draft-ietf-dnssd-update-lease */ { 2, "UL" }, /* draft-ietf-dnssd-update-lease */ { 3, "NSID" }, /* RFC 5001 */ { 5, "DAU" }, /* RFC 6975 */ diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index 0a9e088d4c..b1a8b51535 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -596,10 +596,10 @@ if [ -x "$DIG" ]; then status=$((status + ret)) n=$((n + 1)) - echo_i "checking ednsopt UL prints as expected (single lease) ($n)" + echo_i "checking ednsopt UPDATE-LEASE prints as expected (single lease) ($n)" ret=0 - dig_with_opts @10.53.0.3 +ednsopt=UL:00000e10 +qr a.example >dig.out.test$n 2>&1 || ret=1 - pat='UL: 3600 (1 hour)' + dig_with_opts @10.53.0.3 +ednsopt=UPDATE-LEASE:00000e10 +qr a.example >dig.out.test$n 2>&1 || ret=1 + pat='UPDATE-LEASE: 3600 (1 hour)' grep "$pat" dig.out.test$n >/dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status + ret)) @@ -607,10 +607,10 @@ if [ -x "$DIG" ]; then if [ $HAS_PYYAML -ne 0 ]; then n=$((n + 1)) - echo_i "checking ednsopt UL prints as expected (single lease) +yaml ($n)" + echo_i "checking ednsopt UPDATE-LEASE prints as expected (single lease) +yaml ($n)" ret=0 - dig_with_opts @10.53.0.3 +yaml +ednsopt=UL:00000e10 +qr a.example >dig.out.test$n 2>&1 || ret=1 - $PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS UL LEASE >yamlget.out.test$n 2>&1 || ret=1 + dig_with_opts @10.53.0.3 +yaml +ednsopt=UPDATE-LEASE:00000e10 +qr a.example >dig.out.test$n 2>&1 || ret=1 + $PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS UPDATE-LEASE LEASE >yamlget.out.test$n 2>&1 || ret=1 read -r value /dev/null || ret=1 @@ -619,24 +619,24 @@ if [ -x "$DIG" ]; then fi n=$((n + 1)) - echo_i "checking ednsopt UL prints as expected (split lease) ($n)" + echo_i "checking ednsopt UPDATE-LEASE prints as expected (split lease) ($n)" ret=0 - dig_with_opts @10.53.0.3 +ednsopt=UL:00000e1000127500 +qr a.example >dig.out.test$n 2>&1 || ret=1 - pat='UL: 3600/1209600 (1 hour/2 weeks)' + dig_with_opts @10.53.0.3 +ednsopt=UPDATE-LEASE:00000e1000127500 +qr a.example >dig.out.test$n 2>&1 || ret=1 + pat='UPDATE-LEASE: 3600/1209600 (1 hour/2 weeks)' grep "$pat" dig.out.test$n >/dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status + ret)) if [ $HAS_PYYAML -ne 0 ]; then n=$((n + 1)) - echo_i "checking ednsopt UL prints as expected (split lease) +yaml ($n)" + echo_i "checking ednsopt UPDATE-LEASE prints as expected (split lease) +yaml ($n)" ret=0 - dig_with_opts @10.53.0.3 +yaml +ednsopt=UL:00000e1000127500 +qr a.example >dig.out.test$n 2>&1 || ret=1 - $PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS UL LEASE >yamlget.out.test$n 2>&1 || ret=1 + dig_with_opts @10.53.0.3 +yaml +ednsopt=UPDATE-LEASE:00000e1000127500 +qr a.example >dig.out.test$n 2>&1 || ret=1 + $PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS UPDATE-LEASE LEASE >yamlget.out.test$n 2>&1 || ret=1 read -r value /dev/null || ret=1 - $PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS UL KEY-LEASE >yamlget.out.test$n 2>&1 || ret=1 + $PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS UPDATE-LEASE KEY-LEASE >yamlget.out.test$n 2>&1 || ret=1 read -r value /dev/null || ret=1 diff --git a/lib/dns/message.c b/lib/dns/message.c index bdea5e17e5..858813ddd5 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -3545,7 +3545,7 @@ cleanup: static const char *option_names[] = { [DNS_OPT_LLQ] = "LLQ", - [DNS_OPT_UL] = "UL", + [DNS_OPT_UL] = "UPDATE-LEASE", [DNS_OPT_NSID] = "NSID", [DNS_OPT_DAU] = "DAU", [DNS_OPT_DHU] = "DHU",