Handle truncated response UDP-to-TCP to downstream queries when validating.

A relatively common situation is that the reply to a downstream query
will fit in a UDP packet when no DNSSEC RRs are present, but overflows
when the RRSIGS, NSEC ect are added. This extends the automatic
move from UDP to TCP to downstream queries which get truncated replies,
in the hope that once stripped of the DNSSEC RRs, the reply can be returned
via UDP, nwithout making the downstream retry with TCP.

If the downstream sets the DO bit, (ie it wants the DNSSEC RRs, then
this path is not taken, since the downstream will have to get a truncated
repsonse and retry to get a correct answer.
This commit is contained in:
Simon Kelley
2024-10-12 22:25:06 +01:00
parent 1c26ec2876
commit d15d371051
6 changed files with 193 additions and 88 deletions

View File

@@ -3411,8 +3411,16 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
case 'q': /* --log-queries */
set_option_bool(OPT_LOG);
if (arg && strcmp(arg, "extra") == 0)
set_option_bool(OPT_EXTRALOG);
if (arg)
{
if (strcmp(arg, "extra") == 0)
set_option_bool(OPT_EXTRALOG);
else if (strcmp(arg, "proto") == 0)
{
set_option_bool(OPT_EXTRALOG);
set_option_bool(OPT_LOG_PROTO);
}
}
break;
case LOPT_MAX_LOGS: /* --log-async */