]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Add a proxy protocol header to DoH queries as well
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 21 Feb 2020 18:07:26 +0000 (19:07 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 17 Mar 2020 13:12:55 +0000 (14:12 +0100)
pdns/dnsdistdist/doh.cc

index fcddb9d92964c3dfabf95b9502c06099041de9ae..96a77e88c5bdc07dd2334ad2db77e00eac0f32b9 100644 (file)
@@ -24,6 +24,7 @@
 #include "dns.hh"
 #include "dolog.hh"
 #include "dnsdist-ecs.hh"
+#include "dnsdist-proxy-protocol.hh"
 #include "dnsdist-rules.hh"
 #include "dnsdist-xpf.hh"
 #include "libssl.hh"
@@ -502,6 +503,10 @@ static int processDOHQuery(DOHUnit* du)
 
     dh->id = idOffset;
 
+    if (dq.addProxyProtocol && ss->useProxyProtocol) {
+      addProxyProtocol(dq);
+    }
+
     int fd = pickBackendSocketForSending(ss);
     try {
       /* you can't touch du after this line, because it might already have been freed */