Bug 617063 - [TAHI]There's an extra ipaddress length field (16) in some ipaddress related oid.
[TAHI]There's an extra ipaddress length field (16) in some ipaddress related ...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-snmp (Show other bugs)
6.0
All Linux
high Severity medium
: rc
: ---
Assigned To: Jan Safranek
BaseOS QE Security Team
: RHELNAK
Depends On:
Blocks: 572236
  Show dependency treegraph
 
Reported: 2010-07-22 02:13 EDT by Xiaoli Tian
Modified: 2010-11-10 06:55 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 06:55:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Xiaoli Tian 2010-07-22 02:13:16 EDT
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 Product and Program Management 2010-07-22 02:37:54 EDT
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 07:04:22 EDT
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-22 21:29:14 EDT
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 Product and Program Management 2010-11-10 06:55:06 EST
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.

Note You need to log in before you can comment on or make changes to this bug.