When running net-snmp 5.8 on Fedora 29 (net-snmp-5.8-1.fc29), on a system where IPv6 has been disabled (ipv6.disable=1) the system log (syslog and/or journal) logs:
ipaddress_linux: could not open /proc/net/if_inet6: No such file or directory
several thousands of times a day (presumably whenever certain counters are queried) as these systems are monitored remotely via SNMP.
The attached patch disables the warning.
A different patch has been applied on the v5.8 and master branches, namely a patch that makes snmpd log the error message once instead of multiple times. Please retest.
IMO the patch only addresses the logging effect, not the cause.
According to the snmpd man page, by default snmpd listen on all IPv4 interfaces. Also, it should be possible to specify IPv4 listening address via transport specifier (thus perhaps is no need for some -4 / -6 cmdline switches which are usually seen on other multi-protocol apps) - and in this case "/proc/net/if_inet6" should be never opened.
Maybe NETSNMP_ACCESS_IPADDRESS_LOAD_IPV4_ONLY bit should be set in "load_flags" and isn't ?