Hello.

I found another thing:

$ /tmp/net-snmp-install/bin/snmpwalk -CE sysLocation.0 localhost system
SNMPv2-MIB::sysDescr.0 = STRING: Linux
SNMPv2-MIB::sysObjectID.0 = OID: ccitt.1
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (21341) 0:03:33.41
SNMPv2-MIB::sysContact.0 = STRING: root@
SNMPv2-MIB::sysName.0 = STRING: sara

But

$ /tmp/net-snmp-install/bin/snmpwalk -CE sysLocation.0.0 localhost system
SNMPv2-MIB::system = No Such Object available on this agent at this OID

The problem is that snmpwalk uses a heuristic method to check if enough
of the tree have been seen instead of the expected oid-compare, thus I
propose the attached patch, comments anyone?

Should I add this to HEAD or wait?

/MF
Index: apps/snmpwalk.c
===================================================================
--- apps/snmpwalk.c	(revision 17762)
+++ apps/snmpwalk.c	(working copy)
@@ -310,9 +310,8 @@
                  */
                 for (vars = response->variables; vars;
                      vars = vars->next_variable) {
-                    if ((vars->name_length < end_len)
-                        || (memcmp(end_oid, vars->name, end_len * sizeof(oid))
-                            <= 0)) {
+                    if (snmp_oid_compare(end_oid, end_len,
+                                         vars->name, vars->name_length) <= 0) {
                         /*
                          * not part of this subtree 
                          */
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to