]> granicus.if.org Git - pdns/commitdiff
do not connect the snmpAgent from a dnsdist client. Fixes #6163
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 9 Jan 2018 20:47:04 +0000 (21:47 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 13 Feb 2018 13:57:55 +0000 (14:57 +0100)
(cherry picked from commit cd4bb56b5269fdfc7f180e01b078bcc4cca673af)

pdns/dnsdist-lua2.cc

index 2d27ca6365a5218358241a8319413b36c712809b..75fcf9ed559b0b7ec3b6ea0e2eebb401dd86fe01 100644 (file)
@@ -1382,7 +1382,9 @@ void moreLua(bool client)
         g_useTCPSinglePipe = flag;
       });
 
-    g_lua.writeFunction("snmpAgent", [](bool enableTraps, boost::optional<std::string> masterSocket) {
+    g_lua.writeFunction("snmpAgent", [client](bool enableTraps, boost::optional<std::string> masterSocket) {
+        if(client)
+          return;
 #ifdef HAVE_NET_SNMP
         if (g_configurationDone) {
           errlog("snmpAgent() cannot be used at runtime!");