From de4ad63d16e6d1d62fec31e15bb2729fa9d244f3 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 14 Dec 2017 23:11:25 +0100 Subject: [PATCH] rec: Make sure that the ECS scope from the auth is < to the source (cherry picked from commit 30d4402d06b494c36eb75cff80e2ecce9ca02e17) --- pdns/lwres.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pdns/lwres.cc b/pdns/lwres.cc index 0e0f9e617..fd07f4b89 100644 --- a/pdns/lwres.cc +++ b/pdns/lwres.cc @@ -116,13 +116,17 @@ int asyncresolve(const ComboAddress& ip, const DNSName& domain, int type, bool d string ping; bool weWantEDNSSubnet=false; + uint8_t outgoingECSBits = 0; + ComboAddress outgoingECSAddr; if(EDNS0Level > 0) { DNSPacketWriter::optvect_t opts; if(srcmask) { EDNSSubnetOpts eo; eo.source = *srcmask; + outgoingECSBits = srcmask->getBits(); + outgoingECSAddr = srcmask->getNetwork(); // cout<<"Adding request mask: "<