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

Support DoT, DoH and DNSCrypt transports for protobuf and dnstap #10879

Merged
merged 4 commits into from Oct 22, 2021

Conversation

rgacogne
Copy link
Member

Short description

Closes #9103.

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)

Copy link
Member

@omoerbeek omoerbeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits, OK either way.

const auto distProto = d_dq.getProtocol();
pdns::ProtoZero::Message::TransportProtocol protocol = pdns::ProtoZero::Message::TransportProtocol::UDP;

if (distProto == dnsdist::Protocol::DoTCP) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a switch statement? I like them better than long if else chains.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't because dnsdist::Protocol is not a numerical type, because we needed to convert it to a class so it could accept methods. I could make it downgrade to uint8_t automatically (which Charles-Henri did in his first PR and I asked him to remove, to be completely honest) but I really would like to avoid that since I really want to prevent any mix of integral and dnsdist::Protocol values. I really hate that the freaking enum class type doesn't accept methods, that would make everything much better..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't realize that when reviewing. enum class is a misnomer indeed.

pdns/dnsmessage.proto Show resolved Hide resolved
@@ -1359,10 +1359,10 @@ class SetECSAction : public DNSAction

static DnstapMessage::ProtocolType ProtocolToDNSTap(dnsdist::Protocol protocol)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make a case for a switch statemen here as well.

@rgacogne rgacogne merged commit ca73ffe into PowerDNS:master Oct 22, 2021
@rgacogne rgacogne deleted the ddist-log-transport branch October 22, 2021 13:01
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.

Add transport type to logging output (dnstap & pdns protobuf)
2 participants