Hello.
If you try to register multiple items that fails as follows:
Try to register 1.3.6.1.3.4 - 1.3.6.1.3.6:
Using single registrations we end up with three items in agent_registry:
1.3.6.1.3.4 - 1.3.6.1.3.5
1.3.6.1.3.5 - 1.3.6.1.3.6
1.3.6.1.3.6 - 1.3.6.1.3.7
Using multiple registrations we get three slightly different items:
1.3.6.1.3.4 - 1.3.6.1.3.5
1.3.6.1.3.5 - 1.3.6.1.3.5
1.3.6.1.3.6 - 1.3.6.1.3.6
The attached patch corrects this.
(Yes, I did submit this as patch #1009799 about a week ago but got no
response on that)
/MF
Index: agent/agent_registry.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/agent/agent_registry.c,v
retrieving revision 5.20
diff -c -r5.20 agent_registry.c
*** agent/agent_registry.c 2 Aug 2004 21:17:37 -0000 5.20
--- agent/agent_registry.c 15 Aug 2004 21:03:25 -0000
***************
*** 636,641 ****
--- 636,643 ----
sub2->name_a[range_subid - 1] = i;
sub2->start_a[range_subid - 1] = i;
sub2->end_a[range_subid - 1] = i; /* XXX - ???? */
+ if (range_subid == mibloclen)
+ ++sub2->end_a[range_subid - 1];
res = netsnmp_subtree_load(sub2, context);
sub2->flags |= SUBTREE_ATTACHED;
if (res != MIB_REGISTERED_OK) {