mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
always print a colon after EDNS option names in text output
make the same change as in the previous commit to non-YAML text output, for better readability and consistency between formats.
This commit is contained in:
@@ -3838,8 +3838,8 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
INDENT(style);
|
INDENT(style);
|
||||||
|
|
||||||
if (optcode == DNS_OPT_LLQ) {
|
if (optcode == DNS_OPT_LLQ) {
|
||||||
if (optlen == 18U) {
|
|
||||||
ADD_STRING(target, "; LLQ:");
|
ADD_STRING(target, "; LLQ:");
|
||||||
|
if (optlen == 18U) {
|
||||||
result = render_llq(&optbuf, target);
|
result = render_llq(&optbuf, target);
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
return (result);
|
return (result);
|
||||||
@@ -3847,59 +3847,55 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
ADD_STRING(target, "\n");
|
ADD_STRING(target, "\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ADD_STRING(target, "; LLQ");
|
|
||||||
} else if (optcode == DNS_OPT_NSID) {
|
} else if (optcode == DNS_OPT_NSID) {
|
||||||
ADD_STRING(target, "; NSID");
|
ADD_STRING(target, "; NSID:");
|
||||||
} else if (optcode == DNS_OPT_COOKIE) {
|
} else if (optcode == DNS_OPT_COOKIE) {
|
||||||
ADD_STRING(target, "; COOKIE");
|
ADD_STRING(target, "; COOKIE:");
|
||||||
} else if (optcode == DNS_OPT_CLIENT_SUBNET) {
|
} else if (optcode == DNS_OPT_CLIENT_SUBNET) {
|
||||||
isc_buffer_t ecsbuf;
|
isc_buffer_t ecsbuf;
|
||||||
|
|
||||||
ADD_STRING(target, "; CLIENT-SUBNET");
|
ADD_STRING(target, "; CLIENT-SUBNET:");
|
||||||
isc_buffer_init(&ecsbuf,
|
isc_buffer_init(&ecsbuf,
|
||||||
isc_buffer_current(&optbuf),
|
isc_buffer_current(&optbuf),
|
||||||
optlen);
|
optlen);
|
||||||
isc_buffer_add(&ecsbuf, optlen);
|
isc_buffer_add(&ecsbuf, optlen);
|
||||||
result = render_ecs(&ecsbuf, target);
|
result = render_ecs(&ecsbuf, target);
|
||||||
if (result == ISC_R_NOSPACE)
|
if (result == ISC_R_NOSPACE) {
|
||||||
return (result);
|
return (result);
|
||||||
|
}
|
||||||
if (result == ISC_R_SUCCESS) {
|
if (result == ISC_R_SUCCESS) {
|
||||||
isc_buffer_forward(&optbuf, optlen);
|
isc_buffer_forward(&optbuf, optlen);
|
||||||
ADD_STRING(target, "\n");
|
ADD_STRING(target, "\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (optcode == DNS_OPT_EXPIRE) {
|
} else if (optcode == DNS_OPT_EXPIRE) {
|
||||||
|
ADD_STRING(target, "; EXPIRE:");
|
||||||
if (optlen == 4) {
|
if (optlen == 4) {
|
||||||
uint32_t secs;
|
uint32_t secs;
|
||||||
secs = isc_buffer_getuint32(&optbuf);
|
secs = isc_buffer_getuint32(&optbuf);
|
||||||
ADD_STRING(target, "; EXPIRE: ");
|
|
||||||
snprintf(buf, sizeof(buf), " %u", secs);
|
snprintf(buf, sizeof(buf), " %u", secs);
|
||||||
ADD_STRING(target, buf);
|
ADD_STRING(target, buf);
|
||||||
ADD_STRING(target, " (");
|
ADD_STRING(target, " (");
|
||||||
result = dns_ttl_totext(secs,
|
result = dns_ttl_totext(secs, true,
|
||||||
true,
|
true, target);
|
||||||
true,
|
|
||||||
target);
|
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
ADD_STRING(target, ")\n");
|
ADD_STRING(target, ")\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ADD_STRING(target, "; EXPIRE");
|
|
||||||
} else if (optcode == DNS_OPT_TCP_KEEPALIVE) {
|
} else if (optcode == DNS_OPT_TCP_KEEPALIVE) {
|
||||||
|
ADD_STRING(target, "; TCP KEEPALIVE:");
|
||||||
if (optlen == 2) {
|
if (optlen == 2) {
|
||||||
unsigned int dsecs;
|
unsigned int dsecs;
|
||||||
dsecs = isc_buffer_getuint16(&optbuf);
|
dsecs = isc_buffer_getuint16(&optbuf);
|
||||||
ADD_STRING(target, "; TCP KEEPALIVE:");
|
|
||||||
snprintf(buf, sizeof(buf), " %u.%u",
|
snprintf(buf, sizeof(buf), " %u.%u",
|
||||||
dsecs / 10U, dsecs % 10U);
|
dsecs / 10U, dsecs % 10U);
|
||||||
ADD_STRING(target, buf);
|
ADD_STRING(target, buf);
|
||||||
ADD_STRING(target, " secs\n");
|
ADD_STRING(target, " secs\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ADD_STRING(target, "; TCP KEEPALIVE");
|
|
||||||
} else if (optcode == DNS_OPT_PAD) {
|
} else if (optcode == DNS_OPT_PAD) {
|
||||||
ADD_STRING(target, "; PAD");
|
ADD_STRING(target, "; PAD:");
|
||||||
if (optlen > 0U) {
|
if (optlen > 0U) {
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
" (%u bytes)", optlen);
|
" (%u bytes)", optlen);
|
||||||
@@ -3909,9 +3905,9 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
ADD_STRING(target, "\n");
|
ADD_STRING(target, "\n");
|
||||||
continue;
|
continue;
|
||||||
} else if (optcode == DNS_OPT_KEY_TAG) {
|
} else if (optcode == DNS_OPT_KEY_TAG) {
|
||||||
ADD_STRING(target, "; KEY-TAG");
|
ADD_STRING(target, "; KEY-TAG:");
|
||||||
if (optlen > 0U && (optlen % 2U) == 0U) {
|
if (optlen > 0U && (optlen % 2U) == 0U) {
|
||||||
const char *sep = ": ";
|
const char *sep = "";
|
||||||
uint16_t id;
|
uint16_t id;
|
||||||
while (optlen > 0U) {
|
while (optlen > 0U) {
|
||||||
id = isc_buffer_getuint16(&optbuf);
|
id = isc_buffer_getuint16(&optbuf);
|
||||||
@@ -3926,11 +3922,10 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
}
|
}
|
||||||
} else if (optcode == DNS_OPT_CLIENT_TAG) {
|
} else if (optcode == DNS_OPT_CLIENT_TAG) {
|
||||||
uint16_t id;
|
uint16_t id;
|
||||||
ADD_STRING(target, "; CLIENT-TAG");
|
ADD_STRING(target, "; CLIENT-TAG:");
|
||||||
if (optlen == 2U) {
|
if (optlen == 2U) {
|
||||||
id = isc_buffer_getuint16(&optbuf);
|
id = isc_buffer_getuint16(&optbuf);
|
||||||
snprintf(buf, sizeof(buf), ": %u\n",
|
snprintf(buf, sizeof(buf), " %u\n", id);
|
||||||
id);
|
|
||||||
ADD_STRING(target, buf);
|
ADD_STRING(target, buf);
|
||||||
optlen -= 2;
|
optlen -= 2;
|
||||||
POST(optlen);
|
POST(optlen);
|
||||||
@@ -3938,11 +3933,10 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
}
|
}
|
||||||
} else if (optcode == DNS_OPT_SERVER_TAG) {
|
} else if (optcode == DNS_OPT_SERVER_TAG) {
|
||||||
uint16_t id;
|
uint16_t id;
|
||||||
ADD_STRING(target, "; SERVER-TAG");
|
ADD_STRING(target, "; SERVER-TAG:");
|
||||||
if (optlen == 2U) {
|
if (optlen == 2U) {
|
||||||
id = isc_buffer_getuint16(&optbuf);
|
id = isc_buffer_getuint16(&optbuf);
|
||||||
snprintf(buf, sizeof(buf), ": %u\n",
|
snprintf(buf, sizeof(buf), " %u\n", id);
|
||||||
id);
|
|
||||||
ADD_STRING(target, buf);
|
ADD_STRING(target, buf);
|
||||||
optlen -= 2;
|
optlen -= 2;
|
||||||
POST(optlen);
|
POST(optlen);
|
||||||
@@ -3950,13 +3944,14 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ADD_STRING(target, "; OPT=");
|
ADD_STRING(target, "; OPT=");
|
||||||
snprintf(buf, sizeof(buf), "%u", optcode);
|
snprintf(buf, sizeof(buf), "%u:", optcode);
|
||||||
ADD_STRING(target, buf);
|
ADD_STRING(target, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optlen != 0) {
|
if (optlen != 0) {
|
||||||
int i;
|
int i;
|
||||||
ADD_STRING(target, ": ");
|
|
||||||
|
ADD_STRING(target, " ");
|
||||||
|
|
||||||
optdata = isc_buffer_current(&optbuf);
|
optdata = isc_buffer_current(&optbuf);
|
||||||
for (i = 0; i < optlen; i++) {
|
for (i = 0; i < optlen; i++) {
|
||||||
|
Reference in New Issue
Block a user