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.
This commit is contained in:
Mark Andrews
2025-02-26 15:22:58 +11:00
parent 08b6c9e6b5
commit a6076ee7c1
3 changed files with 15 additions and 14 deletions
+1
View File
@@ -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 */
+13 -13
View File
@@ -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 <yamlget.out.test$n
[ "$value" = "3600" ] || ret=1
grep "LEASE: 3600 # 1 hour" dig.out.test$n >/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 <yamlget.out.test$n
[ "$value" = "3600" ] || ret=1
grep "LEASE: 3600 # 1 hour" dig.out.test$n >/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 <yamlget.out.test$n
[ "$value" = "1209600" ] || ret=1
grep "KEY-LEASE: 1209600 # 2 weeks" dig.out.test$n >/dev/null || ret=1
+1 -1
View File
@@ -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",