Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsdist: Fix invalid proxy protocol payload on a DoH TC to TCP retry #11604

Merged
merged 1 commit into from
May 16, 2022

Conversation

rgacogne
Copy link
Member

@rgacogne rgacogne commented May 4, 2022

Short description

dnsdist forwards incoming DoH queries to its backend over UDP, and retry over TCP if the response is truncated (TC=1).
When the proxy protocol is used between dnsdist and its backend, the second query, over TCP, needs to take into account that the proxy protocol payload has already been handled. This was not properly done in that exact case because the proxy protocol payload length was not propagated to the code handling the TCP communication, leading to the query ID being edited at the wrong offset in the packet and thus to an invalid proxy protocol payload.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

dnsdist forwards incoming DoH queries to its backend over UDP, and
retry over TCP if the response is truncated (TC=1).
When the proxy protocol is used between dnsdist and its backend, the
second query, over TCP, needs to take into account that the proxy
protocol payload has already been handled. This was not properly done
in that exact case because the proxy protocol payload length was not
propagated to the code handling the TCP communication, leading to
the query ID being edited at the wrong offset in the packet and thus
to an invalid proxy protocol payload.
@rgacogne rgacogne merged commit 86ec2ab into PowerDNS:master May 16, 2022
@rgacogne rgacogne deleted the ddist-fix-proxyprotocol-tc-doh branch May 16, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants