From: Remi Gacogne Date: Fri, 2 Jul 2021 13:11:40 +0000 (+0200) Subject: dnsdist: Make the protocol const, simplify the TCP/UDP check X-Git-Tag: dnsdist-1.7.0-alpha1~100^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=333eeb6370dd9a7c6343a981af5e369258bcea11;p=thirdparty%2Fpdns.git dnsdist: Make the protocol const, simplify the TCP/UDP check --- diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 153eee4e12..2f379ed73d 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -126,8 +126,7 @@ struct DNSQuestion bool overTCP() const { - const std::set tcpProto = { Protocol::DoTCP, Protocol::DNSCryptTCP, Protocol::DoT, Protocol::DoH }; - return tcpProto.count(protocol); + return !(protocol == Protocol::DoUDP || protocol == Protocol::DNSCryptUDP); } protected: @@ -162,7 +161,7 @@ public: const uint16_t qclass; uint16_t ecsPrefixLength; uint16_t origFlags; - Protocol protocol; + const Protocol protocol; uint8_t ednsRCode{0}; bool skipCache{false}; bool ecsOverride;