From 30d4402d06b494c36eb75cff80e2ecce9ca02e17 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 --- pdns/lwres.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pdns/lwres.cc b/pdns/lwres.cc index ccbb4dd332..218bb2ad2f 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: "<