]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
deal with no applicable policy for a packet, plus keep a statistic for that. Spotted...
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 1 May 2015 20:30:09 +0000 (22:30 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 1 May 2015 20:30:09 +0000 (22:30 +0200)
pdns/dnsdist-tcp.cc
pdns/dnsdist.cc
pdns/dnsdist.hh

index 22f1628bb46a9324814a1ddc1b717d980bcbe438..dcb51f654c3e4e015023b6c4e22195e886c4e7b9 100644 (file)
@@ -112,6 +112,10 @@ void* tcpClientThread(int pipefd)
          ds = localPolicy->policy(getDownstreamCandidates(g_dstates.getCopy(), pool), ci.remote, qname, qtype, dh);
        }
        int dsock;
+       if(!ds) {
+         g_stats.noPolicy++;
+         break;
+       }
        if(sockets.count(ds->remote) == 0) {
          dsock=sockets[ds->remote]=setupTCPDownstream(ds->remote);
        }
index 6526d1112bfaefba377a9f2c7c26462832b908ff..2ab7ae6da3dd9a0e331c18ec49b9fa014e8dd14f 100644 (file)
@@ -442,8 +442,11 @@ try
        ss = policy(candidates, remote, qname, qtype, dh).get();
       }
 
-      if(!ss)
+      if(!ss) {
+       g_stats.noPolicy++;
        continue;
+       
+      }
       
       ss->queries++;
       
index 4ad49cfae73a112f42010b54ee8632e00a6c3819..387f961b5e68731d6a3019ebe7f81db94becff4d 100644 (file)
@@ -24,6 +24,7 @@ struct DNSDistStats
   stat_t downstreamTimeouts{0};
   stat_t downstreamSendErrors{0};
   stat_t truncFail{0};
+  stat_t noPolicy{0};
   double latency{0};
   
 };