]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix compile errors without snmp support 8838/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 18 Feb 2020 15:37:27 +0000 (16:37 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 18 Feb 2020 16:08:06 +0000 (17:08 +0100)
pdns/dnsdist-lua.cc
pdns/dnsdist-snmp.cc

index 6ec08894fc5f46b8b85f467838e6433e5a539da2..fde5fd0ce90673b49598f4516f8d7189d90769d2 100644 (file)
@@ -1683,11 +1683,9 @@ static void setupLuaConfig(bool client, bool configCheck)
     });
 
   g_lua.writeFunction("sendCustomTrap", [](const std::string& str) {
-#ifdef HAVE_NET_SNMP
       if (g_snmpAgent && g_snmpTrapsEnabled) {
         g_snmpAgent->sendCustomTrap(str);
       }
-#endif /* HAVE_NET_SNMP */
     });
 
   g_lua.writeFunction("setServerPolicy", [](ServerPolicy policy) {
index eefa558b7baea1d4a144dcbe8babdce11505ed84..e62f9f0c1c6ea982d14aedceb17730a3b5101a0b 100644 (file)
@@ -2,6 +2,10 @@
 #include "dnsdist-snmp.hh"
 #include "dolog.hh"
 
+bool g_snmpEnabled{false};
+bool g_snmpTrapsEnabled{false};
+DNSDistSNMPAgent* g_snmpAgent{nullptr};
+
 #ifdef HAVE_NET_SNMP
 
 #define DNSDIST_OID 1, 3, 6, 1, 4, 1, 43315, 3
@@ -52,10 +56,6 @@ static const oid specialMemoryUsageOID[] = { DNSDIST_STATS_OID, 39 };
 
 static std::unordered_map<oid, DNSDistStats::entry_t> s_statsMap;
 
-bool g_snmpEnabled{false};
-bool g_snmpTrapsEnabled{false};
-DNSDistSNMPAgent* g_snmpAgent{nullptr};
-
 /* We are never called for a GETNEXT if it's registered as a
    "instance", as it's "magically" handled for us.  */
 /* a instance handler also only hands us one request at a time, so