I'm calling for votes for a simple patch to the ifTable code. Without this
patch, a NULL pointer could be dereferenced when an interface disappears. [On
Linux, this would be an interface that was down and subsequently had the
driver kernel module removed via rmmod.]

It simply changes from using the (NULL) ifentry pointer from the most
recent poll cycle to using the cached ifentry in the row's data context.


Index: agent/mibgroup/if-mib/ifTable/ifTable_data_access.c
===================================================================
RCS file: 
/cvsroot/net-snmp/net-snmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.c,v
retrieving revision 1.18.2.2
diff -u -p -r1.18.2.2 ifTable_data_access.c
--- agent/mibgroup/if-mib/ifTable/ifTable_data_access.c 25 Jan 2006 16:26:38 
-0000      1.18.2.2
+++ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c 6 Jul 2006 15:53:22 
-0000
@@ -194,7 +194,7 @@ _check_interface_entry_for_updates(ifTab
             DEBUGMSGTL(("ifTable:access", "updating missing entry\n"));
             rowreq_ctx->known_missing = 1;
             rowreq_ctx->data.ifAdminStatus = IFADMINSTATUS_DOWN;
-            if ((!(ifentry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE))
+            if ((!(rowreq_ctx->data.ifentry->ns_flags & 
NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE))
                 && (rowreq_ctx->data.ifOperStatus != IFOPERSTATUS_DOWN))
                 oper_changed = 1;
             rowreq_ctx->data.ifOperStatus = IFOPERSTATUS_DOWN;

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to