Bug 617063

Summary: [TAHI]There's an extra ipaddress length field (16) in some ipaddress related oid.
Product: Red Hat Enterprise Linux 6 Reporter: Xiaoli Tian <xtian>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0CC: jiabwang, llim, ovasik, rvokal
Target Milestone: rcKeywords: RHELNAK
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-10 11:55:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 572236    

Description Xiaoli Tian 2010-07-22 06:13:16 UTC
Description of problem:
Our net-snmp implementation has an extra ipaddress length field in some oid ip related,but it's not needed according to RFC 4293 p.60.
For example: 
our ipAddressIfIndex is 1.3.6.1.2.1.4.34.1.3.2.16.63.254.5.1.255.255.1.0.2.37.100.255.254.166.254.163
but TAHI test specification is 1.3.6.1.2.1.4.34.1.3.2.63.254.5.1.255.255.1.0.2.37.100.255.254.166.254.163.
We have an extra 16.
But according to RFC 4293 p.60 ,the length of this object is the standard length for objects of that type (4 or 16 bytes)

ipAddressPrefixPrefix OBJECT-TYPE
    SYNTAX     InetAddress
    MAX-ACCESS not-accessible
    STATUS     current
    DESCRIPTION
           "The address prefix.  The address type of this object is
            specified in ipAddressPrefixType.  The length of this object
            is the standard length for objects of that type (4 or 16
            bytes).  Any bits after ipAddressPrefixLength must be zero.

            Implementors need to be aware that, if the size of
            ipAddressPrefixPrefix exceeds 114 octets, then OIDS of
            instances of columns in this row will have more than 128
            sub-identifiers and cannot be accessed using SNMPv1,
            SNMPv2c, or SNMPv3."
    ::= { ipAddressPrefixEntry 3 }
That seem to see there's no need to add extra 16 in the implementation when IP address type(IPv4 or IPv6) can distinguish the protocol difference.

 

Version-Release number of selected component (if applicable):
net-snmp-5.5-23.el6.x86_64
net-snmp-libs-5.5-23.el6.x86_64
net-snmp-utils-5.5-23.el6.x86_64
kernel-2.6.32-47.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1.
2.
3.
  
Actual results:
Have an extra 16

Expected results:
No 16

Additional info:

Comment 2 RHEL Program Management 2010-07-22 06:37:54 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 3 Jan Safranek 2010-07-22 11:04:22 UTC
I think Net-SNMP is correct in this case. OID 1.3.6.1.2.1.4.34.1.3.2.16.63.254.5.1.255.255.1.0.2.37.100.255.254.166.254.163 is ipAddressIfIndex.2.16.63.254.5.1.255.255.1.0.2.37.100.255.254.166.254.163.

Looking at the RFC 4293 (Management Information Base for the Internet Protocol, a.k.a. IP-MIB), it says that ipAddressTable is made of ipAddressEntry rows, which has following indexes:

ipAddressEntry OBJECT-TYPE
    SYNTAX     IpAddressEntry
    MAX-ACCESS not-accessible
    STATUS     current
    DESCRIPTION
           "An address mapping for a particular interface."
    INDEX { ipAddressAddrType, ipAddressAddr }
    ::= { ipAddressTable 1 }


ipAddressType is a simple integer number (that's the ipAddressIfIndex.*2*)

ipAddressType OBJECT-TYPE
    SYNTAX     INTEGER {
                 unicast(1),
                 anycast(2),
                 broadcast(3)
    }
    MAX-ACCESS read-create
...

And ipAddressAddr has type InetAddress, which is imported from INET-ADDRESS-MIB, RFC 4001:

InetAddress ::= TEXTUAL-CONVENTION
    STATUS current
    DESCRIPTION <...>
    SYNTAX      OCTET STRING (SIZE (0..255))

That means InetAddress is an OCTET STRING, with defined minimal and maximal size and special handling when printing it (i.e. IPv4 addresses in nice 127.0.0.1 format, IPv6  in ::1 format, as defined later in the RFC). But still, it's plain OCTET STRING.

And variable-size octet string is encoded into OID as 'length . 1st byte . 2nd byte . 3rd byte . ...', see RFC 2578, chap. 7.7:

(3)  string-valued, variable-length strings (not preceded by the IMPLIED
     keyword):  `n+1' sub-identifiers, where `n' is the length of the
     string (the first sub-identifier is `n' itself, following this,
     each octet of the string is encoded in a separate sub-identifier);

Comment 4 Xiaoli Tian 2010-07-23 01:29:14 UTC
Hi,Jan

Thanks for your hard work to analyse RFCs.As you analysed in Comment 3 ,our  net-snmp implementation is correct,it may be a bug of TAHI.Ok,I will tell TAHI.

xiaoli

(In reply to comment #3)
> I think Net-SNMP is correct in this case. OID
> 1.3.6.1.2.1.4.34.1.3.2.16.63.254.5.1.255.255.1.0.2.37.100.255.254.166.254.163
> is ipAddressIfIndex.2.16.63.254.5.1.255.255.1.0.2.37.100.255.254.166.254.163.
>

Comment 6 RHEL Program Management 2010-11-10 11:55:06 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.