::arg().setSwitch("webserver","Start a webserver for monitoring")="no";
::arg().setSwitch("webserver-print-arguments","If the webserver should print arguments")="no";
::arg().setSwitch("edns-subnet-processing","If we should act on EDNS Subnet options")="no";
- ::arg().set("edns-subnet-option-numbers","Comma separated list of whitelisted non-standard EDNS subnet option codes (8 is always included)")="20730";
::arg().setSwitch("any-to-tcp","Answer ANY queries with tc=1, shunting to TCP")="no";
::arg().set("webserver-address","IP Address of webserver to listen on")="127.0.0.1";
::arg().set("webserver-port","Port of webserver to listen on")="8081";
DNSPacket::s_udpTruncationThreshold = std::max(512, ::arg().asNum("udp-truncation-threshold"));
DNSPacket::s_doEDNSSubnetProcessing = ::arg().mustDo("edns-subnet-processing");
- {
- std::vector<std::string> codes;
- stringtok(codes, ::arg()["edns-subnet-option-numbers"], "\t ,");
- BOOST_FOREACH(std::string &code, codes) {
- DNSPacket::s_ednssubnetcodes.push_back(boost::lexical_cast<int>(code));
- }
- }
if(!::arg()["chroot"].empty()) {
if(::arg().mustDo("master") || ::arg().mustDo("slave"))
gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded
#include "ednssubnet.hh"
bool DNSPacket::s_doEDNSSubnetProcessing;
-std::vector<int> DNSPacket::s_ednssubnetcodes;
uint16_t DNSPacket::s_udpTruncationThreshold;
DNSPacket::DNSPacket()
d_eso = orig.d_eso;
d_haveednssubnet = orig.d_haveednssubnet;
d_haveednssection = orig.d_haveednssection;
- d_ednssubnetcode = orig.d_ednssubnetcode;
d_dnssecOk = orig.d_dnssecOk;
d_rrs=orig.d_rrs;
eso.scope = Netmask(eso.source.getNetwork(), maxScopeMask);
string opt = makeEDNSSubnetOptsString(eso);
- opts.push_back(make_pair(d_ednssubnetcode, opt)); // 'EDNS SUBNET'
+ opts.push_back(make_pair(8, opt)); // 'EDNS SUBNET'
}
if(!opts.empty() || d_haveednssection || d_dnssecOk)
r->d_eso = d_eso;
r->d_haveednssubnet = d_haveednssubnet;
r->d_haveednssection = d_haveednssection;
- r->d_ednssubnetcode = d_ednssubnetcode;
if(!d_tsigkeyname.empty()) {
r->d_tsigkeyname = d_tsigkeyname;
else if(iter->first == 5) {// 'EDNS PING'
d_ednsping = iter->second;
}
- else if(s_doEDNSSubnetProcessing && (iter->first == 8 || std::find(s_ednssubnetcodes.begin(), s_ednssubnetcodes.end(), iter->first) != s_ednssubnetcodes.end())) { // 'EDNS SUBNET'
+ else if(s_doEDNSSubnetProcessing && (iter->first == 8)) { // 'EDNS SUBNET'
if(getEDNSSubnetOptsFromString(iter->second, &d_eso)) {
//cerr<<"Parsed, source: "<<d_eso.source.toString()<<", scope: "<<d_eso.scope.toString()<<", family = "<<d_eso.scope.getNetwork().sin4.sin_family<<endl;
d_haveednssubnet=true;
- d_ednssubnetcode=iter->first;
}
}
else {
TSIGRecordContent d_trc;
static bool s_doEDNSSubnetProcessing;
static uint16_t s_udpTruncationThreshold;
- static std::vector<int> s_ednssubnetcodes;
private:
void pasteQ(const char *question, int length); //!< set the question of this packet, useful for crafting replies
string d_ednsping;
bool d_wantsnsid;
bool d_haveednssubnet;
- int d_ednssubnetcode;
bool d_haveednssection;
EDNSSubnetOpts d_eso;
string d_tsigsecret;
#
# do-ipv6-additional-processing=yes
-#################################
-# edns-subnet-option-numbers Comma separated list of whitelisted non-standard EDNS subnet option codes (8 is always included)
-#
-# edns-subnet-option-numbers=20730
-
#################################
# edns-subnet-processing If we should act on EDNS Subnet options
#