|
|
32b8a0 |
diff -up net-snmp-5.8/agent/mibgroup/if-mib/data_access/interface_linux.c.original net-snmp-5.8/agent/mibgroup/if-mib/data_access/interface_linux.c
|
|
|
32b8a0 |
--- net-snmp-5.8/agent/mibgroup/if-mib/data_access/interface_linux.c.original 2022-02-02 15:06:29.382119898 +0900
|
|
|
32b8a0 |
+++ net-snmp-5.8/agent/mibgroup/if-mib/data_access/interface_linux.c 2022-02-02 15:15:39.298280447 +0900
|
|
|
32b8a0 |
@@ -600,7 +600,6 @@ netsnmp_arch_interface_container_load(ne
|
|
|
32b8a0 |
{
|
|
|
32b8a0 |
FILE *devin;
|
|
|
32b8a0 |
char line[256];
|
|
|
32b8a0 |
- netsnmp_interface_entry *entry = NULL;
|
|
|
32b8a0 |
static char scan_expected = 0;
|
|
|
32b8a0 |
int fd;
|
|
|
32b8a0 |
#ifdef NETSNMP_ENABLE_IPV6
|
|
|
32b8a0 |
@@ -669,6 +668,7 @@ netsnmp_arch_interface_container_load(ne
|
|
|
32b8a0 |
* and retrieve (or create) the corresponding data structure.
|
|
|
32b8a0 |
*/
|
|
|
32b8a0 |
while (fgets(line, sizeof(line), devin)) {
|
|
|
32b8a0 |
+ netsnmp_interface_entry *entry = NULL;
|
|
|
32b8a0 |
char *stats, *ifstart = line;
|
|
|
32b8a0 |
u_int flags;
|
|
|
32b8a0 |
oid if_index;
|
|
|
32b8a0 |
@@ -701,6 +701,11 @@ netsnmp_arch_interface_container_load(ne
|
|
|
32b8a0 |
*stats++ = 0; /* null terminate name */
|
|
|
32b8a0 |
|
|
|
32b8a0 |
if_index = netsnmp_arch_interface_index_find(ifstart);
|
|
|
32b8a0 |
+ if (if_index == 0) {
|
|
|
32b8a0 |
+ DEBUGMSGTL(("access:interface", "network interface %s is gone",
|
|
|
32b8a0 |
+ ifstart));
|
|
|
32b8a0 |
+ continue;
|
|
|
32b8a0 |
+ }
|
|
|
32b8a0 |
|
|
|
32b8a0 |
/*
|
|
|
32b8a0 |
* set address type flags.
|
|
|
32b8a0 |
@@ -726,7 +731,7 @@ netsnmp_arch_interface_container_load(ne
|
|
|
32b8a0 |
continue;
|
|
|
32b8a0 |
}
|
|
|
32b8a0 |
|
|
|
32b8a0 |
- entry = netsnmp_access_interface_entry_create(ifstart, 0);
|
|
|
32b8a0 |
+ entry = netsnmp_access_interface_entry_create(ifstart, if_index);
|
|
|
32b8a0 |
if(NULL == entry) {
|
|
|
32b8a0 |
#ifdef NETSNMP_ENABLE_IPV6
|
|
|
32b8a0 |
netsnmp_access_ipaddress_container_free(addr_container, 0);
|
|
|
32b8a0 |
|