Fix DNSSEC work counting when swapping from UDP to TCP

This commit is contained in:
Simon Kelley
2024-09-23 16:45:12 +01:00
parent f5cdb007d8
commit e9a7cd0a50
4 changed files with 26 additions and 4 deletions

View File

@@ -924,6 +924,9 @@ static void dnssec_validate(struct frec *forward, struct dns_header *header,
if (extract_name(header, plen, &p, daemon->namebuff, 0, 4) == 1)
log_query(F_UPSTREAM | F_NOEXTRA, daemon->namebuff, NULL, "truncated", (forward->flags & FREC_DNSKEY_QUERY) ? T_DNSKEY : T_DS);
/* Don't count failed UDP attempt AND TCP */
orig->work_counter++;
/* NOTE: Can't move connection marks from UDP to TCP */
status = swap_to_tcp(forward, now, (forward->flags & FREC_DNSKEY_QUERY) ? STAT_NEED_KEY_QUERY : STAT_NEED_DS_QUERY,
header, forward->stash_len, forward->class, forward->sentto, &orig->work_counter, &orig->validate_counter);