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

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