Bug 221682 - snmp on rh4u4 ia64 does not handle negative values correctly.
snmp on rh4u4 ia64 does not handle negative values correctly.
Status: CLOSED DUPLICATE of bug 211457
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp (Show other bugs)
4.4
All Linux
medium Severity high
: ---
: ---
Assigned To: Radek Vokal
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-05 19:56 EST by John DeFranco
Modified: 2007-11-16 20:14 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-12 03:11:02 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 John DeFranco 2007-01-05 19:56:16 EST
Description of problem:

RH4U4/ia64 shows an interesting problem when you try to lookup negative numbers
via snmp. 

Here is an example. The value of tcpMaxConn.0 should be -1. Instead what happens
is we get the truncating message then we end up with a very,very big value
(looks like an inverted value):

[root@bake snmp]# snmpget -v 1 bake -c public tcpMaxConn.0
truncating integer value to 32 bits
TCP-MIB::tcpMaxConn.0 = INTEGER: 4294967295
[root@bake snmp]# 

Now on rh4u2 on the same platform shows this correctly:

[root@simmer ~]# snmpget -v 1 simmer -c public tcpMaxConn.0
TCP-MIB::tcpMaxConn.0 = INTEGER: -1
[root@simmer ~]# 

Something has changed between u2 and u4 to break this.


Version-Release number of selected component (if applicable):


How reproducible:

Lookup any snmp value that is negative (as shown above).


Steps to Reproduce:
1. Configure snmp
2. use snmpwalk or snmpget to dump the mip components
  
Actual results:
[root@bake snmp]# snmpget -v 1 bake -c public tcpMaxConn.0
truncating integer value to 32 bits
TCP-MIB::tcpMaxConn.0 = INTEGER: 4294967295
[root@bake snmp]# 

Expected results:
[root@simmer ~]# snmpget -v 1 simmer -c public tcpMaxConn.0
TCP-MIB::tcpMaxConn.0 = INTEGER: -1
[root@simmer ~]# 

Additional info:

This has to be some kind of configuration or other such issue. There has to be
an easy way around this, I would think.
Comment 1 John DeFranco 2007-01-08 16:51:06 EST
FYI:

It would appear that this coming from asn_parse_unsigned_int64() routine in the
file asn1.c:

    *datalength -= (int) asn_length + (bufp - data);
    if (*bufp & 0x80)
        value = ~value;         /* integer is negative */

    DEBUGDUMPSETUP("recv", data, bufp - data + asn_length);

    while (asn_length--)
        value = (value << 8) | *bufp++;

#if SIZEOF_LONG != 4
    if (value > 0xffffffff) {
        snmp_log(LOG_ERR,"truncating uinteger value to 32 bits\n");
        value &= 0xffffffff;
    }
#endif


This is directly from the net-snmp-5.1.2-11.EL4.7.src.rpm from the rh4U4 distro.

This code has been changed quite a bit in this area and looks like overflow and
the like is checked for differently which is why this problem is not seen in
this version.
Comment 2 Radek Vokal 2007-01-12 03:11:02 EST
This bug will be fixed in RHEL4.5. The issue is already known and fixed.

*** This bug has been marked as a duplicate of 211457 ***

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