[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-support
Subject:    [ net-snmp-Support Requests-410369 ] getnext and header_simple_table()
From:       noreply () sourceforge ! net
Date:       2001-03-22 20:28:27
[Download RAW message or body]

Support Requests item #410369, was updated on 2001-03-21 12:10
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=212694&aid=410369&group_id=12694

Category: None
Group: None
>Status: Closed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Wes Hardaker (hardaker)
Summary: getnext and header_simple_table()

Initial Comment:
In agent/mibgroup/util_func.c header_simple_table() appears to have a problem with getnext for 
oid with a longer length than expected. 

For example: the following command returns the following:
snmpgetnext -p 175 10.0.0.42 public system.sysORTable.sysOREntry.sysORUpTime.1.1

interfaces.ifNumber.0 = 31

It should return the value for sysOrUpTime.2.

This is utilizing UCD SNMP 4.2 on a Linux PPC system.


----------------------------------------------------------------------

>Comment By: Wes Hardaker (hardaker)
Date: 2001-03-22 12:28

Message:
Logged In: YES 
user_id=76242

Fixed with the following patch:

Index: util_funcs.c
===================================================================
RCS file:
/cvsroot/net-snmp/net-snmp/agent/mibgroup/util_funcs.c,v
retrieving revision 1.58
diff -u -r1.58 util_funcs.c
--- util_funcs.c	2000/09/26 20:11:20	1.58
+++ util_funcs.c	2001/03/22 20:24:44
@@ -541,7 +541,6 @@
     }
   }
   if (rtest > 0 ||
-      (rtest == 0 && !exact && (int)(vp->namelen+1) < (int)
*length) ||
     (exact == 1 && (rtest || (int)*length !=
(int)(vp->namelen+1)))) {
     if (var_len)
 	*var_len = 0;
@@ -554,6 +553,10 @@
     memmove(newname, vp->name, (int)vp->namelen * sizeof
(oid));
     newname[vp->namelen] = 1;
     *length = vp->namelen+1;
+  } else if (*length > vp->namelen+1) {  /* exact case
checked earlier */
+    *length = vp->namelen+1;
+    memmove(newname, name, (*length) * sizeof(oid));
+    newname[*length-1] = name[*length-1] + 1;
   }
   else {
     *length = vp->namelen+1;


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=212694&aid=410369&group_id=12694

_______________________________________________
Net-snmp-support mailing list
Net-snmp-support@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/net-snmp-support

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic