Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 20db51d70e6b59a061db97ce9b89c771 > files > 60

net-snmp-5.3.2.2-14.el5.src.rpm

554956 - The snmpd reports a error message 'error on subcontainer '' insert (-1)' for alias interfaces

see the text below + in addition use TRY_INSESRT to suppress the 'error on subcontainer'

commit 6de2b526da50558b4bd11e16905975f70a632812
Author: jsafranek <jsafranek@06827809-a52a-0410-b366-d66718629ded>
Date:   Thu Jan 14 12:34:56 2010 +0000

    CHANGES: fixed memory leak in RMON-MIB and ETHERLIKE-MIB when there are multiple aliases of an network interface
    Rationale: the aliased interfaces have the same ifIndex -> CONTAINER_INSERT fails, but the rejected entry was not freed.
    
    git-svn-id: https://net-snmp.svn.sourceforge.net/svnroot/net-snmp/trunk@18006 06827809-a52a-0410-b366-d66718629ded

diff --git a/net-snmp/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c b/net-snmp/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c
index a69a299..98beac1 100644
--- a/net-snmp/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c
+++ b/net-snmp/agent/mibgroup/etherlike-mib/dot3StatsTable/dot3StatsTable_data_access.c
@@ -317,7 +317,7 @@ dot3StatsTable_container_load(netsnmp_container * container)
             dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
             continue;
         }
-        
+
         rc = interface_ioctl_dot3stats_duplex_get(rowreq_ctx, fd, p->name);
         if (rc < 0) {
             DEBUGMSGTL(("access:dot3StatsTable", "error getting the duplex status for |%s| "
@@ -329,7 +329,13 @@ dot3StatsTable_container_load(netsnmp_container * container)
         /*
          * insert into table container
          */
-        CONTAINER_INSERT(container, rowreq_ctx);
+        rc = CONTAINER_TRY_INSERT(container, rowreq_ctx);
+        if (rc < 0) {
+            DEBUGMSGTL(("access:dot3StatsTable", "error inserting |%s|", p->name));
+            dot3StatsTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+
         ++count;
     }
 
diff --git a/net-snmp/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c b/net-snmp/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
index 98cbea7..2064248 100644
--- a/net-snmp/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
+++ b/net-snmp/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
@@ -310,7 +310,13 @@ etherStatsTable_container_load(netsnmp_container * container)
         /*
          * insert into table container
          */
-        CONTAINER_INSERT(container, rowreq_ctx);
+        rc = CONTAINER_TRY_INSERT(container, rowreq_ctx);
+        if (rc < 0) {
+            DEBUGMSGTL(("access:etherStatsTable", "error inserting |%s| ", p->name));
+            etherStatsTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+
         ++count;
     }