dig wasn't printing BADCOOKIE

This commit is contained in:
Mark Andrews 2017-11-09 04:47:21 +00:00
parent 64ccc050d7
commit 1f88828520

View file

@ -126,13 +126,12 @@ rcode_totext(dns_rcode_t rcode)
{
static char buf[sizeof("?65535")];
if (rcode == dns_rcode_badcookie)
return ("BADCOOKIE");
if (rcode >= (sizeof(rcodetext)/sizeof(rcodetext[0]))) {
snprintf(buf, sizeof(buf), "?%u", rcode);
return (buf);
} else if (rcode == dns_rcode_badcookie)
return ("BADCOOKIE");
else
return (rcodetext[rcode]);
return (rcodetext[rcode]);
}
/*% print usage */