From 8464c603664a9d52fdf775413fdbd99357fab566 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 8 Nov 2022 10:36:07 +0100 Subject: [PATCH] dnsdist: Fix building with boost < 1.56 boost::optional::value_or() has been introduced in 1.56 and we only require 1.53, so stop using it. --- pdns/dnsdist-lua-bindings.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/dnsdist-lua-bindings.cc b/pdns/dnsdist-lua-bindings.cc index 8f0894d925..ced2f8a3d7 100644 --- a/pdns/dnsdist-lua-bindings.cc +++ b/pdns/dnsdist-lua-bindings.cc @@ -538,12 +538,12 @@ void setupLuaBindings(LuaContext& luaCtx, bool client) default: throw std::runtime_error("Unsupported action for BPFFilter::block"); } - return bpf->addRangeRule(Netmask(range), force.value_or(false), match); + return bpf->addRangeRule(Netmask(range), force ? *force : false, match); }); luaCtx.registerFunction::*)(const DNSName& qname, boost::optional qtype, boost::optional action)>("blockQName", [](std::shared_ptr bpf, const DNSName& qname, boost::optional qtype, boost::optional action) { if (bpf) { if (!action) { - return bpf->block(qname, BPFFilter::MatchAction::Drop, qtype.value_or(255)); + return bpf->block(qname, BPFFilter::MatchAction::Drop, qtype ? *qtype : 255); } else { BPFFilter::MatchAction match; @@ -561,7 +561,7 @@ void setupLuaBindings(LuaContext& luaCtx, bool client) default: throw std::runtime_error("Unsupported action for BPFFilter::blockQName"); } - return bpf->block(qname, match, qtype.value_or(255)); + return bpf->block(qname, match, qtype ? *qtype : 255); } } }); -- 2.47.2