Ignore interfaces without statistics

Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-02-07

Gbp-Pq: Name 02_statistics.patch
This commit is contained in:
Net-SNMP Packaging Team 2022-06-27 15:01:26 +08:00 committed by Lu zhiping
parent db974ed3d6
commit 01543d3031
1 changed files with 5 additions and 1 deletions

View File

@ -1588,6 +1588,10 @@ Interface_Scan_Init(void)
struct ifnet *nnew;
char *stats, *ifstart = line;
/* Ignore interfaces with no statistics. */
if (strstr(line, "No statistics available."))
continue;
if (line[strlen(line) - 1] == '\n')
line[strlen(line) - 1] = '\0';
@ -1620,7 +1624,7 @@ Interface_Scan_Init(void)
&coll) != 5)) {
if ((scan_line_to_use == scan_line_2_2)
&& !strstr(line, "No statistics available"))
snmp_log(LOG_ERR,
snmp_log(LOG_DEBUG,
"/proc/net/dev data format error, line ==|%s|",
line);
continue;