From: Remi Gacogne Date: Thu, 26 Oct 2017 12:12:36 +0000 (+0200) Subject: dnsdist: Fix TeeAction() with EDNS Client Subnet X-Git-Tag: rec-4.1.0-rc2~5^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc115deaa329b29a3173c0f4879ee011a32ef6ad;p=pdns dnsdist: Fix TeeAction() with EDNS Client Subnet 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. --- diff --git a/pdns/dnsdistdist/dnsrulactions.cc b/pdns/dnsdistdist/dnsrulactions.cc index 6bb750822..6f80ea61b 100644 --- a/pdns/dnsdistdist/dnsrulactions.cc +++ b/pdns/dnsdistdist/dnsrulactions.cc @@ -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; }