From: Remi Gacogne Date: Fri, 29 Sep 2023 08:31:43 +0000 (+0200) Subject: dnsdist: Display whether blocks are eBPF-based in `showDynBlocks()` X-Git-Tag: dnsdist-1.8.3~1^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6592bc42e58214154d775f29fd6f29bf09bb8ed;p=thirdparty%2Fpdns.git dnsdist: Display whether blocks are eBPF-based in `showDynBlocks()` (cherry picked from commit 8959c0adf0f5be11c2c5dac1b86efe41881e81e1) --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index f90a2b25e6..fa1b8b6bb4 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -1399,15 +1399,15 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) auto slow = g_dynblockNMG.getCopy(); struct timespec now; gettime(&now); - boost::format fmt("%-24s %8d %8d %-10s %-20s %s\n"); - g_outputBuffer = (fmt % "What" % "Seconds" % "Blocks" % "Warning" % "Action" % "Reason").str(); + boost::format fmt("%-24s %8d %8d %-10s %-20s %-10s %s\n"); + g_outputBuffer = (fmt % "What" % "Seconds" % "Blocks" % "Warning" % "Action" % "eBPF" % "Reason").str(); for (const auto& e : slow) { if (now < e.second.until) { uint64_t counter = e.second.blocks; if (g_defaultBPFFilter && e.second.bpf) { counter += g_defaultBPFFilter->getHits(e.first.getNetwork()); } - g_outputBuffer += (fmt % e.first.toString() % (e.second.until.tv_sec - now.tv_sec) % counter % (e.second.warning ? "true" : "false") % DNSAction::typeToString(e.second.action != DNSAction::Action::None ? e.second.action : g_dynBlockAction) % e.second.reason).str(); + g_outputBuffer += (fmt % e.first.toString() % (e.second.until.tv_sec - now.tv_sec) % counter % (e.second.warning ? "true" : "false") % DNSAction::typeToString(e.second.action != DNSAction::Action::None ? e.second.action : g_dynBlockAction) % (g_defaultBPFFilter && e.second.bpf ? "*" : "") % e.second.reason).str(); } } auto slow2 = g_dynblockSMT.getCopy(); @@ -1416,7 +1416,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) string dom("empty"); if (!node.d_value.domain.empty()) dom = node.d_value.domain.toString(); - g_outputBuffer += (fmt % dom % (node.d_value.until.tv_sec - now.tv_sec) % node.d_value.blocks % (node.d_value.warning ? "true" : "false") % DNSAction::typeToString(node.d_value.action != DNSAction::Action::None ? node.d_value.action : g_dynBlockAction) % node.d_value.reason).str(); + g_outputBuffer += (fmt % dom % (node.d_value.until.tv_sec - now.tv_sec) % node.d_value.blocks % (node.d_value.warning ? "true" : "false") % DNSAction::typeToString(node.d_value.action != DNSAction::Action::None ? node.d_value.action : g_dynBlockAction) % "" % node.d_value.reason).str(); } }); });