From dc115deaa329b29a3173c0f4879ee011a32ef6ad Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 26 Oct 2017 14:12:36 +0200 Subject: [PATCH] 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. --- pdns/dnsdistdist/dnsrulactions.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.40.0