From eaca956402864667e6d20a2db37390239efa0747 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Tue, 9 Jan 2018 21:47:04 +0100 Subject: [PATCH] do not connect the snmpAgent from a dnsdist client. Fixes #6163 (cherry picked from commit cd4bb56b5269fdfc7f180e01b078bcc4cca673af) --- pdns/dnsdist-lua2.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdist-lua2.cc b/pdns/dnsdist-lua2.cc index 2d27ca6365a5..75fcf9ed559b 100644 --- a/pdns/dnsdist-lua2.cc +++ b/pdns/dnsdist-lua2.cc @@ -1382,7 +1382,9 @@ void moreLua(bool client) g_useTCPSinglePipe = flag; }); - g_lua.writeFunction("snmpAgent", [](bool enableTraps, boost::optional masterSocket) { + g_lua.writeFunction("snmpAgent", [client](bool enableTraps, boost::optional masterSocket) { + if(client) + return; #ifdef HAVE_NET_SNMP if (g_configurationDone) { errlog("snmpAgent() cannot be used at runtime!");