From 478c786e145726b283aa35391ba71f3f0016da89 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 5 Dec 2016 17:23:40 +0100 Subject: [PATCH] dnsdist: Ignore newBPFFilter() and newDynBPFFilter() in client mode --- pdns/dnsdist-lua2.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist-lua2.cc b/pdns/dnsdist-lua2.cc index 87330d33b..3f7609a8f 100644 --- a/pdns/dnsdist-lua2.cc +++ b/pdns/dnsdist-lua2.cc @@ -902,7 +902,10 @@ void moreLua(bool client) }); #ifdef HAVE_EBPF - g_lua.writeFunction("newBPFFilter", [](uint32_t maxV4, uint32_t maxV6, uint32_t maxQNames) { + g_lua.writeFunction("newBPFFilter", [client](uint32_t maxV4, uint32_t maxV6, uint32_t maxQNames) { + if (client) { + return std::shared_ptr(nullptr); + } return std::make_shared(maxV4, maxV6, maxQNames); }); @@ -978,7 +981,10 @@ void moreLua(bool client) g_defaultBPFFilter = bpf; }); - g_lua.writeFunction("newDynBPFFilter", [](std::shared_ptr bpf) { + g_lua.writeFunction("newDynBPFFilter", [client](std::shared_ptr bpf) { + if (client) { + return std::shared_ptr(nullptr); + } return std::make_shared(bpf); }); -- 2.40.0