16003771 net-snmp service records a registration error when service is enabled s11-update
authorCharly Abraham <Charly.Abraham@Sun.COM>
Fri, 24 Oct 2014 06:34:14 -0500
branchs11-update
changeset 3418 e8909b770a1a
parent 3415 e7a2a94a22a2
child 3420 8e187df4069d
16003771 net-snmp service records a registration error when service is enabled
components/net-snmp/patches/045.16003771.agent_registry.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/045.16003771.agent_registry.patch	Fri Oct 24 06:34:14 2014 -0500
@@ -0,0 +1,33 @@
+This patch taken from the net-snmp community fixes, an issue related to registration
+error recorded in the /var/log/snmpd.log file when snmp is enabled.
+
+The details can be found in the following location
+http://sourceforge.net/p/net-snmp/patches/973/
+--- a/agent/agent_registry.c	2012-12-18 02:02:56.032682052 -0800
++++ b/agent/agent_registry.c	2012-12-18 02:34:11.953844076 -0800
+@@ -532,7 +532,23 @@
+	
+	    if (next && (next->namelen  == new_sub->namelen) &&
+		(next->priority == new_sub->priority)) {
+-                netsnmp_assert(!"registration != duplicate"); /* always false */
++                if (new_sub->namelen != 1) {    /* ignore root OID dups */
++                    size_t          out_len = 0;
++                    size_t          buf_len = 0;
++                    char           *buf = NULL;
++                    int             buf_overflow = 0;
++
++                    netsnmp_sprint_realloc_objid((u_char **) &buf, &buf_len, &out_len,
++                                                 1, &buf_overflow,
++                                                 new_sub->start_a,
++                                                 new_sub->start_len);
++                    snmp_log(LOG_ERR,
++                             "duplicate registration: MIB modules %s and %s (oid %s%s).\n",
++                             next->label_a, new_sub->label_a,
++                             buf ? buf : "",
++                             buf_overflow ? " [TRUNCATED]" : "");
++                    free(buf);
++                }
+		return MIB_DUPLICATE_REGISTRATION;
+	    }
+ 
+