From: Remi Gacogne Date: Wed, 18 Nov 2020 20:54:28 +0000 (+0100) Subject: rec: Don't use a boost::optional to store "spoof-nearmiss-max" X-Git-Tag: auth-4.5.0-alpha0~15^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e73106c08e155a52a43fecab1f8376a393332751;p=thirdparty%2Fpdns.git rec: Don't use a boost::optional to store "spoof-nearmiss-max" --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 6b5a7bcaed..414666ddcf 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -693,7 +693,7 @@ LWResult::Result asendto(const char *data, size_t len, int flags, LWResult::Result arecvfrom(std::string& packet, int flags, const ComboAddress& fromaddr, size_t *d_len, uint16_t id, const DNSName& domain, uint16_t qtype, int fd, const struct timeval* now) { - static const boost::optional nearMissLimit = ::arg().asNum("spoof-nearmiss-max"); + static const unsigned int nearMissLimit = ::arg().asNum("spoof-nearmiss-max"); PacketID pident; pident.fd=fd; @@ -713,8 +713,8 @@ LWResult::Result arecvfrom(std::string& packet, int flags, const ComboAddress& f *d_len=packet.size(); - if (*nearMissLimit && pident.nearMisses > *nearMissLimit) { - g_log< "<<*nearMissLimit<<") bogus answers for '"< 0 && pident.nearMisses > nearMissLimit) { + g_log< "<