diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index ae986e4a51..0a9e088d4c 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -612,7 +612,8 @@ if [ -x "$DIG" ]; then 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 read -r value /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status + ret)) fi @@ -633,10 +634,12 @@ if [ -x "$DIG" ]; then 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 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 read -r value /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status + ret)) fi @@ -834,7 +837,8 @@ if [ -x "$DIG" ]; then dig_with_opts @10.53.0.1 +yaml +expire . soa >dig.out.test$n 2>&1 || ret=1 $PYTHON yamlget.py dig.out.test$n 0 message response_message_data OPT_PSEUDOSECTION EDNS EXPIRE >yamlget.out.test$n 2>&1 || ret=1 read -r value /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status + ret)) fi diff --git a/lib/dns/message.c b/lib/dns/message.c index 2b054d0af6..bdea5e17e5 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -3692,18 +3692,17 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg, dns_pseudosection_t section, snprintf(buf, sizeof(buf), " %u", secs); ADD_STRING(target, buf); - ADD_STRING(target, " ("); + ADD_STRING(target, " # "); result = dns_ttl_totext(secs, true, true, target); if (result != ISC_R_SUCCESS) { goto cleanup; } - ADD_STRING(target, ")"); + ADD_STRING(target, "\n"); if (optlen == 8U) { key = isc_buffer_getuint32( &optbuf); - ADD_STRING(target, "\n"); INDENT(style); ADD_STRING(target, "KEY-LEASE:"); @@ -3711,16 +3710,15 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg, dns_pseudosection_t section, " %u", key); ADD_STRING(target, buf); - ADD_STRING(target, " ("); + ADD_STRING(target, " # "); result = dns_ttl_totext( key, true, true, target); if (result != ISC_R_SUCCESS) { goto cleanup; } - ADD_STRING(target, ")"); + ADD_STRING(target, "\n"); } - ADD_STRING(target, "\n"); continue; } break; @@ -3746,13 +3744,13 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg, dns_pseudosection_t section, secs = isc_buffer_getuint32(&optbuf); snprintf(buf, sizeof(buf), " %u", secs); ADD_STRING(target, buf); - ADD_STRING(target, " ("); + ADD_STRING(target, " # "); result = dns_ttl_totext(secs, true, true, target); if (result != ISC_R_SUCCESS) { goto cleanup; } - ADD_STRING(target, ")\n"); + ADD_STRING(target, "\n"); continue; } break;