From: Pieter Lexis Date: Thu, 25 May 2017 13:59:49 +0000 (+0200) Subject: calidns: ensure cache hitrate is sane X-Git-Tag: rec-4.1.0-alpha1~95^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a76eab7c7e3e7d09422835dc086923bc4c6ac3f;p=thirdparty%2Fpdns.git calidns: ensure cache hitrate is sane --- diff --git a/pdns/calidns.cc b/pdns/calidns.cc index 77f613f3cb..9241a2e997 100644 --- a/pdns/calidns.cc +++ b/pdns/calidns.cc @@ -232,7 +232,12 @@ try bool wantRecursion = g_vm.count("want-recursion"); - double hitrate = g_vm["hitrate"].as() / 100; + double hitrate = g_vm["hitrate"].as(); + if (hitrate > 100 || hitrate < 0) { + cerr<<"hitrate must be between 0 and 100, not "<(); struct sched_param param;