]> granicus.if.org Git - pdns/commitdiff
dnsdist: Fix TeeAction() with EDNS Client Subnet
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 26 Oct 2017 12:12:36 +0000 (14:12 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 26 Oct 2017 12:12:36 +0000 (14:12 +0200)
Since 0beaa5c825059986d3ce108a4bd2578a08d6d1d0 we checked the space
available against the current length, instead of the real capacity,
resulting in the query being dropped because it looked like there
was not enough room to add the ECS value.

pdns/dnsdistdist/dnsrulactions.cc

index 6bb750822c75c29aeffcfa470b487c167355d05a..6f80ea61bf26a4a49cd02658980450190517aad9 100644 (file)
@@ -72,7 +72,7 @@ DNSAction::Action TeeAction::operator()(DNSQuestion* dq, string* ruleresult) con
       query.reserve(dq->size);
       query.assign((char*) dq->dh, len);
 
-      if (!handleEDNSClientSubnet((char*) query.c_str(), query.size(), dq->qname->wirelength(), &len, &ednsAdded, &ecsAdded, *dq->remote, dq->ecsOverride, dq->ecsPrefixLength)) {
+      if (!handleEDNSClientSubnet((char*) query.c_str(), query.capacity(), dq->qname->wirelength(), &len, &ednsAdded, &ecsAdded, *dq->remote, dq->ecsOverride, dq->ecsPrefixLength)) {
         return DNSAction::Action::None;
       }