]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Fix compile issue if net-snmp has NETSNMP_DISABLE_MD5 set
authorThomas Renninger <trenn@suse.com>
Tue, 31 Jan 2023 15:40:42 +0000 (16:40 +0100)
committerMatthias Runge <mrunge@matthias-runge.de>
Wed, 1 Feb 2023 07:01:49 +0000 (08:01 +0100)
Otherwise one gets:
src/snmp.c: In function 'csnmp_config_add_host_auth_protocol':
src/snmp.c:678:25: error: 'usmHMACMD5AuthProtocol' undeclared (first use in this function); did you mean 'usmHMACSHA1AuthProtocol'?
   678 |     hd->auth_protocol = usmHMACMD5AuthProtocol;
       |                         ^~~~~~~~~~~~~~~~~~~~~~
       |                         usmHMACSHA1AuthProtocol

src/snmp.c

index 827d62eb7cba32b27cf9b016502385937727202b..078ef3eee6b822c82934d0d6eedf20b503cf8167 100644 (file)
@@ -677,7 +677,7 @@ static int csnmp_config_add_host_auth_protocol(host_definition_t *hd,
   if (status != 0)
     return status;
 
-#ifdef NETSNMP_USMAUTH_HMACMD5
+#ifndef NETSNMP_DISABLE_MD5
   if (strcasecmp("MD5", buffer) == 0) {
     hd->auth_protocol = usmHMACMD5AuthProtocol;
     hd->auth_protocol_len = sizeof(usmHMACMD5AuthProtocol) / sizeof(oid);