30 lines
1.1 KiB
Diff
30 lines
1.1 KiB
Diff
|
From: Thomas Renninger <trenn@suse.com>
|
||
|
Subject: Fix compile issue if net-snmp has NETSNMP_DISABLE_MD5 set
|
||
|
References:
|
||
|
Patch-Mainline:
|
||
|
Git-commit: be1a9d5975e4568774a46711d1366086978e9347
|
||
|
Git-repo: git@github.com:watologo1/collectd.git.git
|
||
|
|
||
|
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
|
||
|
|
||
|
|
||
|
Signed-off-by: <trenn@suse.com>
|
||
|
diff --git a/src/snmp.c b/src/snmp.c
|
||
|
index 827d62eb..078ef3ee 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);
|