[Pkg-net-snmp-devel] Bug#383380: snmp: "Index out of range" error on valid Unsigned32 index value

Kevin Humphries kevin.humphries at alcatel.com
Wed Aug 16 21:11:56 UTC 2006


Package: snmp
Version: 5.2.2-5
Severity: important
Tags: patch

While running snmptest, the following error message is seen.  In this
case it is doing a simple GET, but SETs will also fail this way.  The
variable is of type Ospfv3AreaIdTC which is an Unsigned32 
(0..'FFFFFFFF'h) value.  Due to the casting of the upper and lower bounds
as a signed int for range checking, the values of 0 - 0x7FFFFFFF all fail.
 (See MIB definition below).  Attached is a patch that will fixed this problem.

Variable: ospfv3AreaStatus.2
ospfv3AreaStatus.2: Unknown Object Identifier (Index out of range: 2 (ospfv3AreaId))
Variable:

relevant parts of the MIB definition ( ref: draft-ietf-ospf-ospfv3-mib-09.txt)

Ospfv3AreaIdTc ::= TEXTUAL-CONVENTION 
             DISPLAY-HINT "d" 
             STATUS      current 
             DESCRIPTION 
                "An OSPFv3 Area Identifier" 
             SYNTAX      Unsigned32 (0..'FFFFFFFF'h) 

[...]

    ospfv3AreaTable OBJECT-TYPE 
            SYNTAX          SEQUENCE OF Ospfv3AreaEntry 
            MAX-ACCESS      not-accessible 
            STATUS          current 
            DESCRIPTION 
                "Information describing the configured  
                parameters and cumulative statistics of the router's 
                attached areas." 
            REFERENCE 
                "OSPF Version 2, Section 6 The Area Data  
                Structure" 
            ::= { ospfv3Objects 2 } 
 
    ospfv3AreaEntry OBJECT-TYPE 
            SYNTAX          Ospfv3AreaEntry 
            MAX-ACCESS      not-accessible 
            STATUS          current 
            DESCRIPTION 
                "Information describing the configured  
                parameters and cumulative statistics of one of the 
                router's attached areas." 
            INDEX           { ospfv3AreaId } 
            ::= { ospfv3AreaTable 1 } 
 
    Ospfv3AreaEntry ::= SEQUENCE { 
            ospfv3AreaId 
                    Ospfv3AreaIdTc, 
            [...]
            } 
 
    ospfv3AreaId OBJECT-TYPE 
            SYNTAX          Ospfv3AreaIdTc 
            MAX-ACCESS      not-accessible 
            STATUS          current 
            DESCRIPTION 
                "A 32-bit integer uniquely identifying an area. 
                Area ID 0 is used for the OSPFv3 backbone." 
            REFERENCE 
                "OSPF Version 2, Appendix C.2 Area parameters" 
            ::= { ospfv3AreaEntry 1 } 


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-2-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages snmp depends on:
ii  libc6                         2.3.6-15   GNU C Library: Shared libraries
ii  libsnmp9                      5.2.2-5    NET SNMP (Simple Network Managemen

Versions of packages snmp recommends:
ii  perl-modules                  5.8.8-6.1  Core Perl modules

-- no debconf information
-------------- next part --------------
--- net-snmp-5.2.2/snmplib/mib.c	2005-09-26 17:42:35.000000000 -0600
+++ net-snmp-5.2.2-fixed/snmplib/mib.c	2006-08-15 15:36:10.000000000 -0600
@@ -5158,8 +5158,8 @@
                 struct range_list *rp = tp->ranges;
                 int             ok = 0;
                 while (!ok && rp)
-                    if ((rp->low <= (int) subid)
-                        && ((int) subid <= rp->high))
+                    if (((unsigned int) rp->low <= subid)
+                        && (subid <= (unsigned int) rp->high))
                         ok = 1;
                     else
                         rp = rp->next;


More information about the Pkg-net-snmp-devel mailing list