From: Thomas Renninger Date: Tue, 31 Jan 2023 15:40:42 +0000 (+0100) Subject: Fix compile issue if net-snmp has NETSNMP_DISABLE_MD5 set X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5193b713d9dd8765e4885625b9046814966d8686;p=thirdparty%2Fcollectd.git Fix compile issue if net-snmp has NETSNMP_DISABLE_MD5 set 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 --- diff --git a/src/snmp.c b/src/snmp.c index 827d62eb7..078ef3eee 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -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);