From f097141b65b2ac27b3ce4b539c3c5ce2f67ea85c Mon Sep 17 00:00:00 2001 From: Charles-Henri Bruyand Date: Tue, 27 Mar 2018 13:42:52 +0200 Subject: [PATCH] rec: fallback to std::set when boost::container::flat_set is not available (boost version < 1.48) --- pdns/pdns_recursor.cc | 7 ++++++- pdns/recursordist/configure.ac | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index d148546e33..302d2863bf 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -26,8 +26,9 @@ #include #include #include - +#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP #include +#endif #include "ws-recursor.hh" #include #include "recpacketcache.hh" @@ -161,7 +162,11 @@ static bool g_gettagNeedsEDNSOptions{false}; static time_t g_statisticsInterval; static bool g_useIncomingECS; std::atomic g_maxCacheEntries, g_maxPacketCacheEntries; +#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP static boost::container::flat_set s_avoidUdpSourcePorts; +#else +static std::set s_avoidUdpSourcePorts; +#endif static uint16_t s_minUdpSourcePort; static uint16_t s_maxUdpSourcePort; diff --git a/pdns/recursordist/configure.ac b/pdns/recursordist/configure.ac index cc489370c1..5fd6249271 100644 --- a/pdns/recursordist/configure.ac +++ b/pdns/recursordist/configure.ac @@ -90,6 +90,10 @@ AS_IF([test "x$PROTOBUF_LIBS" != "x" -a x"$PROTOC" != "x"], ) BOOST_REQUIRE([$boost_required_version]) + +# Check against flat_set header that requires boost >= 1.48 +BOOST_FIND_HEADER([boost/container/flat_set.hpp]) + PDNS_SELECT_CONTEXT_IMPL PDNS_ENABLE_UNIT_TESTS -- 2.47.2