MIB-II: Only log once that opening /proc/net/if_inet6 failed

If IPv6 has been disabled (ipv6.disable=1) then opening /proc/net/if_inet6
fails. Only log this once instead of thousand of times a day.

Reported-by: Fif <lefif@users.sourceforge.net>

Origin: upstream, https://sourceforge.net/p/net-snmp/code/ci/cd09fd8252
Bug: https://sourceforge.net/p/net-snmp/bugs/2903/
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1871307
Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Last-Update: 2020-04-09

Gbp-Pq: Name lp1871307-log-once-proc-net-if_inet6-failure.patch
This commit is contained in:
Ubuntu Developers 2022-06-27 15:01:27 +08:00 committed by Lu zhiping
parent d4e577609c
commit ece77a0814
1 changed files with 1 additions and 1 deletions

View File

@ -234,7 +234,7 @@ _load_v6(netsnmp_container *container, int idx_offset)
#define PROCFILE "/proc/net/if_inet6"
if (!(in = fopen(PROCFILE, "r"))) {
snmp_log_perror("ipaddress_linux: could not open " PROCFILE);
NETSNMP_LOGONCE((LOG_ERR, "ipaddress_linux: could not open " PROCFILE));
return -2;
}