Blame SOURCES/net-snmp-5.8-ipv6-disabled.patch

d2813a
diff -urNp a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
d2813a
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c	2020-09-29 14:08:09.742478965 +0200
d2813a
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c	2020-10-01 14:20:25.575174851 +0200
d2813a
@@ -19,6 +19,7 @@
d2813a
 
d2813a
 #include <errno.h>
d2813a
 #include <sys/ioctl.h>
d2813a
+#include <sys/stat.h>
d2813a
 
d2813a
 netsnmp_feature_require(prefix_info)
d2813a
 netsnmp_feature_require(find_prefix_info)
d2813a
@@ -234,7 +235,18 @@ _load_v6(netsnmp_container *container, i
d2813a
 
d2813a
 #define PROCFILE "/proc/net/if_inet6"
d2813a
     if (!(in = fopen(PROCFILE, "r"))) {
d2813a
-        NETSNMP_LOGONCE((LOG_ERR, "ipaddress_linux: could not open " PROCFILE));
d2813a
+
d2813a
+        /* 
d2813a
+         * If PROCFILE exists, but isn't readable, file ERROR message.
d2813a
+         * Otherwise log nothing, due of IPv6 support on this machine is
d2813a
+         * intentionaly disabled/unavailable.
d2813a
+         */
d2813a
+
d2813a
+        struct stat filestat;
d2813a
+
d2813a
+        if(stat(PROCFILE, &filestat) == 0){
d2813a
+            NETSNMP_LOGONCE((LOG_ERR, "ipaddress_linux: could not open " PROCFILE));
d2813a
+        }
d2813a
         return -2;
d2813a
     }
d2813a