From 8f133915fb2a249a5e9caeb1c00ed3c8cd76c43f Mon Sep 17 00:00:00 2001 From: bert hubert Date: Fri, 30 Oct 2015 21:29:50 +0100 Subject: [PATCH] move default ACL installation to before config file parsing, so you can override it. --- pdns/dnsdist-tcp.cc | 2 -- pdns/dnsdist.cc | 13 +++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 2b885c4ef..1fb6b2746 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -110,8 +110,6 @@ void* tcpClientThread(int pipefd) uint16_t qlen, rlen; string pool; - - shared_ptr ds; try { for(;;) { diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 28edad3cb..a2f922cf1 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -419,9 +419,7 @@ try if(dh->qr) // don't respond to responses continue; - DNSName qname(packet, len, 12, false, &qtype); - g_rings.queryRing.push_back(qname); if(blockFilter) { @@ -432,7 +430,6 @@ try continue; } } - DNSAction::Action action=DNSAction::Action::None; string ruleresult; @@ -1021,7 +1018,6 @@ try g_cmdLine.remotes.push_back(*p); } - g_maxOutstanding = 1024; ServerPolicy leastOutstandingPol{"leastOutstanding", leastOutstanding}; @@ -1033,6 +1029,11 @@ try _exit(EXIT_SUCCESS); } + auto acl = g_ACL.getCopy(); + for(auto& addr : {"127.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "169.254.0.0/16", "192.168.0.0/16", "172.16.0.0/12", "::1/128", "fc00::/7", "fe80::/10"}) + acl.addMask(addr); + g_ACL.setState(acl); + auto todo=setupLua(false, g_cmdLine.config); if(g_cmdLine.locals.size()) { @@ -1084,10 +1085,6 @@ try for(auto& t : todo) t(); - auto acl = g_ACL.getCopy(); - for(auto& addr : {"127.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "169.254.0.0/16", "192.168.0.0/16", "172.16.0.0/12", "::1/128", "fc00::/7", "fe80::/10"}) - acl.addMask(addr); - g_ACL.setState(acl); if(g_cmdLine.remotes.size()) { for(const auto& address : g_cmdLine.remotes) { -- 2.40.0