[Pkg-net-snmp-commits] r235 - branches/net-snmp54/debian/patches

jochen at alioth.debian.org jochen at alioth.debian.org
Tue Apr 29 15:56:57 UTC 2008


Author: jochen
Date: 2008-04-29 15:56:56 +0000 (Tue, 29 Apr 2008)
New Revision: 235

Added:
   branches/net-snmp54/debian/patches/47_prevent_partial_inserts.README
   branches/net-snmp54/debian/patches/47_prevent_partial_inserts.patch
Log:
Upstream Changeset 16804:
snmplib: Change CONTAINER_INSERT to not do partial inserts in containers with
multiple indices when one insert fails.


Added: branches/net-snmp54/debian/patches/47_prevent_partial_inserts.README
===================================================================
--- branches/net-snmp54/debian/patches/47_prevent_partial_inserts.README	                        (rev 0)
+++ branches/net-snmp54/debian/patches/47_prevent_partial_inserts.README	2008-04-29 15:56:56 UTC (rev 235)
@@ -0,0 +1,3 @@
+Upstream Changeset 16804:
+snmplib: Change CONTAINER_INSERT to not do partial inserts in containers with
+multiple indices when one insert fails.

Added: branches/net-snmp54/debian/patches/47_prevent_partial_inserts.patch
===================================================================
--- branches/net-snmp54/debian/patches/47_prevent_partial_inserts.patch	                        (rev 0)
+++ branches/net-snmp54/debian/patches/47_prevent_partial_inserts.patch	2008-04-29 15:56:56 UTC (rev 235)
@@ -0,0 +1,126 @@
+Index: net-snmp/snmplib/container.c
+===================================================================
+--- net-snmp/snmplib/container.c	(Revision 16803)
++++ net-snmp/snmplib/container.c	(Revision 16804)
+@@ -268,31 +268,41 @@
+  * These functions should EXACTLY match the inline version in
+  * container.h. If you change one, change them both.
+  */
+-int CONTAINER_INSERT(netsnmp_container *x, const void *k)
+-{ 
+-    int rc2, rc = 0;
+-    
+-    /** start at first container */
+-    while(x->prev)
+-        x = x->prev;
+-    for(; x; x = x->next) {
+-        if ((NULL != x->insert_filter) &&
+-            (x->insert_filter(x,k) == 1))
+-            continue;
+-        rc2 = x->insert(x,k);
+-        if (rc2) {
++int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k)
++{
++    while(x && x->insert_filter && x->insert_filter(x,k) == 1)
++        x = x->next;
++    if(x) {
++        int rc = x->insert(x,k);
++        if(rc)
+             snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n",
+-                     x->container_name ? x->container_name : "", rc2);
+-            rc = rc2;
++                     x->container_name ? x->container_name : "", rc);
++        else {
++            rc = CONTAINER_INSERT_HELPER(x->next, k);
++            if(rc)
++                x->remove(x,k);
+         }
++        return rc;
+     }
+-    return rc;
++    return 0;
+ }
+ 
+ /*------------------------------------------------------------------
+  * These functions should EXACTLY match the inline version in
+  * container.h. If you change one, change them both.
+  */
++int CONTAINER_INSERT(netsnmp_container* x, const void* k)
++{
++    /** start at first container */
++    while(x->prev)
++        x = x->prev;
++    return CONTAINER_INSERT_HELPER(x, k);
++}
++
++/*------------------------------------------------------------------
++ * These functions should EXACTLY match the inline version in
++ * container.h. If you change one, change them both.
++ */
+ int CONTAINER_REMOVE(netsnmp_container *x, const void *k)
+ {
+     int rc2, rc = 0;
+Index: net-snmp/include/net-snmp/library/container.h
+===================================================================
+--- net-snmp/include/net-snmp/library/container.h	(Revision 16803)
++++ net-snmp/include/net-snmp/library/container.h	(Revision 16804)
+@@ -351,32 +351,43 @@
+      * container.c. If you change one, change them both.
+      */
+     NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */
+-    int CONTAINER_INSERT(netsnmp_container *x, const void *k)
++    int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k)
+     {
+-        int rc2, rc = 0;
+-        
+-        /** start at first container */
+-        while(x->prev)
+-            x = x->prev;
+-        for(; x; x = x->next) {
+-            if ((NULL != x->insert_filter) &&
+-                (x->insert_filter(x,k) == 1))
+-                continue;
+-            rc2 = x->insert(x,k);
+-            if (rc2) {
++        while(x && x->insert_filter && x->insert_filter(x,k) == 1)
++            x = x->next;
++        if(x) {
++            int rc = x->insert(x,k);
++            if(rc)
+ /*                snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n",
+-                         x->container_name ? x->container_name : "", rc2); */
+-                rc = rc2;
++                         x->container_name ? x->container_name : "", rc); */ ;
++            else {
++                rc = CONTAINER_INSERT_HELPER(x->next, k);
++                if(rc)
++                    x->remove(x,k);
+             }
++            return rc;
+         }
+-        return rc;
++        return 0;
+     }
+-    
++
+     /*------------------------------------------------------------------
+      * These functions should EXACTLY match the function version in
+      * container.c. If you change one, change them both.
+      */
+     NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */
++    int CONTAINER_INSERT(netsnmp_container* x, const void* k)
++    {
++        /** start at first container */
++        while(x->prev)
++            x = x->prev;
++        return CONTAINER_INSERT_HELPER(x, k);
++    }
++
++    /*------------------------------------------------------------------
++     * These functions should EXACTLY match the function version in
++     * container.c. If you change one, change them both.
++     */
++    NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */
+     int CONTAINER_REMOVE(netsnmp_container *x, const void *k)
+     {
+         int rc2, rc = 0;




More information about the Pkg-net-snmp-commits mailing list