I was looking at the interface code again, and noticed that the container load
function doesn't check the return code for _parse_stats. In case of an error
from scanf, _parse_stats will delete the entry before returning. The load
routine continues, and adds this deleted pointer to the container. (I'm
guessing this code used to be in the load function, and the return used to
be a continue, so nothing was added to the container.)

This patch removed the free, so the interface will show up in ifTable, but
without statistics.

[Another alternative would be to check the rc and not insert the data, so the
interface would not show up in ifTable.]

Index: agent/mibgroup/if-mib/data_access/interface_linux.c
================================================== =================
--- agent/mibgroup/if-mib/data_access/interface_linux.c (revision 16589)
+++ agent/mibgroup/if-mib/data_access/interface_linux.c (working copy)
@@ -379,7 +379,6 @@
snmp_log(LOG_ERR,
"error scanning interface data (expected %d, got %d)\n",
expected, scan_count);
- netsnmp_access_interface_entry_free(entry);
return scan_count;
}
entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_ACTIVE;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders