Further refactoring of the TCP DNS codepath.

It's not t a thing of beauty, but it's less ugly than it was.
Any bugs, I blame on what I started from....
This commit is contained in:
Simon Kelley
2024-12-19 16:38:47 +00:00
parent 32248ebd5b
commit 3eb008c36d
2 changed files with 156 additions and 190 deletions

View File

@@ -1191,7 +1191,7 @@ unsigned int extract_request(struct dns_header *header, size_t qlen, char *name,
if (ntohs(header->qdcount) != 1 || OPCODE(header) != QUERY)
return 0; /* must be exactly one query. */
if (!(header->hb3 & HB3_QR) && (ntohs(header->ancount) != 0 || ntohs(header->nscount) != 0))
return 0; /* non-standard query. */