Bug 32244

Summary: ucd-snmp-4.2-3 on IA64 returns 8 bytes for IP address instead of 4 bytes
Product: [Retired] Red Hat Linux Reporter: Matt Domsch <matt_domsch>
Component: ucd-snmpAssignee: Phil Knirsch <pknirsch>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: high    
Version: 7.3CC: john_hull, msw, notting, pknirsch, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-06-07 18:25:33 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:

Description Matt Domsch 2001-03-19 17:41:13 UTC
Dell TeamTrack Issue Id: DFCT30203
For IP address attributes in MIBs that it implements, the ucd-snmp-4.2-3 
agent returns 8 bytes for the IP address when it should return 4 bytes.  
Those attributes are defined in their MIBs to be type IpAddress.  
IpAddress is defined to be 4 bytes in SNMPv1 and SNMPv2.

Some of the tables with this problem are:  atTable, ipAddrTable, 
ipRouteTable, and ipNetToMediaTable.  Those tables are in the MIB-II MIB.  
There may be more tables with IP address attributes in the MIB-II MIB and 
other MIBs implmented by the ucd-snmp agent.

Note:  When the ucd-snmp utilities (e.g. snmpget, snmpwalk, etc.) display 
IP addresses, they ignore the value length in the returned varbind and 
print the first 4 bytes of the IP address.  You need to used other SNMP 
utilities to see this problem.

Comment 1 edward_blazek 2001-04-20 19:23:18 UTC
Here is more information on the problem and a possiable patch to the issue.  

--- ucd-snmp-4.2/agent/mibgroup/mibII/ipAddr.c.ipaddr Fri Nov  3 00:19:06 2000
+++ ucd-snmp-4.2/agent/mibgroup/mibII/ipAddr.c Thu Apr 19 17:39:58 2001
@@ -222,6 +222,7 @@
     switch(vp->magic){
case IPADADDR:
#if defined(linux) || defined(sunV3)
+     *var_len = 4;
             return(u_char *) &((struct sockaddr_in *) &lowin_ifnet.if_addr)-
>sin_addr.s_addr;
#else
    return(u_char *) &((struct sockaddr_in *) &lowin_ifaddr.ia_addr)-
>sin_addr.s_addr;
@@ -232,6 +233,7 @@
case IPADNETMASK:
#ifndef sunV3
#ifdef linux
+     *var_len = 4;
             return (u_char *)&((struct sockaddr_in *)
&lowin_ifnet.ia_subnetmask)->sin_addr.s_addr;
#else
    long_return = lowin_ifaddr.ia_subnetmask;
@@ -241,6 +243,7 @@
case IPADBCASTADDR:
    
#if defined(linux) || defined(sunV3)
+     *var_len = 4;
    long_return = ntohl(((struct sockaddr_in *) &lowin_ifnet.ifu_broadaddr)-
>sin_addr.s_addr) & 1;
#else
    long_return = ntohl(((struct sockaddr_in *) &lowin_ifaddr.ia_broadaddr)-
>sin_addr.s_addr) & 1;


This is a critical issue with the IA64 Beta release that Dell would like fixed 
in the next release.
EAB

Comment 2 Matt Domsch 2001-04-20 19:36:51 UTC
Matt W. or Bill, could you take a look at the proposed patch, and if it makes 
sense, please apply to your tree so that we can include this in the next IA-64 
build. Thanks!

Comment 3 Bill Nottingham 2001-04-20 21:07:20 UTC
patch added in 4.2-14.

Comment 4 Matt Domsch 2001-05-24 15:43:30 UTC
Additional instances where IpAddr is 8 bytes not four were found.  Can we root-
cause this and fix the definition of IpAddr?

Dell DFCT33567:
The ucd-snmp-4.2-14 agent on IA64 returns 8 bytes for atNetAddress when it 
should return 4 bytes.

Dell DFCT33572:
The ucd-snmp-4.2-14 agent on IA64 returns 8 bytes for ipRouteDest, 
ipRouteNextHop, and ipRouteMask when it should return 4 bytes.  Those 
attributes are defined in the MIB-II MIB to be type IpAddress.  IpAddress is 
defined to be 4 bytes in SNMPv1 and SNMPv2.

Dell DFCT33573:
The ucd-snmp-4.2-14 agent on IA64 returns 8 bytes for ipNetToMediaNetAddress
when it should return 4 bytes.  Those attributes are defined in the MIB-II MIB 
to be type IpAddress.  IpAddress is defined to be 4 bytes in SNMPv1 and SNMPv2.

Dell DFCT33574:
The ucd-snmp-4.2-14 agent on IA64 returns 8 bytes for udpLocalAddress
when it should return 4 bytes.  Those attributes are defined in the MIB-II MIB 
to be type IpAddress.  IpAddress is defined to be 4 bytes in SNMPv1 and SNMPv2.

Note:  When the ucd-snmp utilities (e.g. snmpget, snmpwalk, etc.) display IP 
addresses, they ignore the value length in the returned varbind and print the 
first 4 bytes of the IP address.  You need to used other SNMP utilities to see 
this problem.



Comment 5 Bill Nottingham 2001-06-01 20:07:40 UTC
I've added a newer patch in ucd-snmp-4.2-15; if this could get tested to
see if it fixes the problem, it would be good.

Comment 6 Bill Nottingham 2001-06-07 18:25:30 UTC
This was reported as being fixed.

Comment 7 Matt Domsch 2001-06-07 19:03:40 UTC
Dell OpenManage team reports this fixed.  Thanks!  Closing.