equal
deleted
inserted
replaced
|
1 This patch taken from the net-snmp community fixes, an issue related to registration |
|
2 error recorded in the /var/log/snmpd.log file when snmp is enabled. |
|
3 |
|
4 The details can be found in the following location |
|
5 http://sourceforge.net/p/net-snmp/patches/973/ |
|
6 --- a/agent/agent_registry.c 2012-12-18 02:02:56.032682052 -0800 |
|
7 +++ b/agent/agent_registry.c 2012-12-18 02:34:11.953844076 -0800 |
|
8 @@ -532,7 +532,23 @@ |
|
9 |
|
10 if (next && (next->namelen == new_sub->namelen) && |
|
11 (next->priority == new_sub->priority)) { |
|
12 - netsnmp_assert(!"registration != duplicate"); /* always false */ |
|
13 + if (new_sub->namelen != 1) { /* ignore root OID dups */ |
|
14 + size_t out_len = 0; |
|
15 + size_t buf_len = 0; |
|
16 + char *buf = NULL; |
|
17 + int buf_overflow = 0; |
|
18 + |
|
19 + netsnmp_sprint_realloc_objid((u_char **) &buf, &buf_len, &out_len, |
|
20 + 1, &buf_overflow, |
|
21 + new_sub->start_a, |
|
22 + new_sub->start_len); |
|
23 + snmp_log(LOG_ERR, |
|
24 + "duplicate registration: MIB modules %s and %s (oid %s%s).\n", |
|
25 + next->label_a, new_sub->label_a, |
|
26 + buf ? buf : "", |
|
27 + buf_overflow ? " [TRUNCATED]" : ""); |
|
28 + free(buf); |
|
29 + } |
|
30 return MIB_DUPLICATE_REGISTRATION; |
|
31 } |
|
32 |
|
33 |