Blame SOURCES/net-snmp-5.8-flood-messages.patch

ea601b
From cd09fd82522861830aaf9d237b26eef5f9ba50d2 Mon Sep 17 00:00:00 2001
ea601b
From: Bart Van Assche <bvanassche@acm.org>
ea601b
Date: Wed, 21 Nov 2018 20:47:42 -0800
ea601b
Subject: [PATCH] MIB-II: Only log once that opening /proc/net/if_inet6 failed
ea601b
ea601b
If IPv6 has been disabled (ipv6.disable=1) then opening /proc/net/if_inet6
ea601b
fails. Only log this once instead of thousand of times a day.
ea601b
ea601b
Reported-by: Fif <lefif@users.sourceforge.net>
ea601b
---
ea601b
 agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | 2 +-
ea601b
 1 file changed, 1 insertion(+), 1 deletion(-)
ea601b
ea601b
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
ea601b
index 5ddead3e0..280575ce3 100644
ea601b
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
ea601b
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
ea601b
@@ -234,7 +234,7 @@ _load_v6(netsnmp_container *container, int idx_offset)
ea601b
ea601b
 #define PROCFILE "/proc/net/if_inet6"
ea601b
     if (!(in = fopen(PROCFILE, "r"))) {
ea601b
-        snmp_log_perror("ipaddress_linux: could not open " PROCFILE);
ea601b
+        NETSNMP_LOGONCE((LOG_ERR, "ipaddress_linux: could not open " PROCFILE));
ea601b
         return -2;
ea601b
     }
ea601b