Bug 200255

Summary: representation of IPv4 and IPv6 addresses and port numbers in TCP/UDP MIB are buggy
Product: [Fedora] Fedora Reporter: Peter Bieringer <pb>
Component: net-snmpAssignee: Radek Vokál <rvokal>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: redhat
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 5.3.1.0-6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-30 09:37:26 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 Peter Bieringer 2006-07-26 15:08:15 UTC
During running tests relating to bug
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=194583 (missing IPv6
support in TCP/UDP MIB) it was found that the representation is buggy.

It's still buggy in current devel version:

Version-Release number of selected component (if applicable):
net-snmp-5.3.1.0-1

How reproducible:
every time

Steps to Reproduce:
1. install net-snmp
2. configure /etc/snmp/snmpd.conf to be able to retrieve the whole tree


# LC_ALL=C netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address            
State       PID/Program name
tcp        0      0 127.0.0.1:20389             0.0.0.0:*                  
LISTEN      3854/ssh
tcp        0      0 0.0.0.0:902                 0.0.0.0:*                  
LISTEN      1557/xinetd
tcp        0      0 0.0.0.0:199                 0.0.0.0:*                  
LISTEN      24982/snmpd
tcp        0      0 0.0.0.0:43340               0.0.0.0:*                  
LISTEN      -
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                  
LISTEN      1388/portmap
tcp        0      0 0.0.0.0:6000                0.0.0.0:*                  
LISTEN      1936/X
tcp        0      0 0.0.0.0:53106               0.0.0.0:*                  
LISTEN      1406/rpc.statd
tcp        0      0 127.0.0.1:631               0.0.0.0:*                  
LISTEN      1826/cupsd
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                  
LISTEN      1708/master
tcp        0      0 127.0.0.1:20636             0.0.0.0:*                  
LISTEN      3854/ssh
tcp        0      0 ::1:20389                   :::*                       
LISTEN      3854/ssh
tcp        0      0 :::6000                     :::*                       
LISTEN      1936/X
tcp        0      0 :::22                       :::*                       
LISTEN      1548/sshd
tcp        0      0 ::1:20636                   :::*                       
LISTEN      3854/ssh

Related entries in SNMP:

$ snmpwalk -v 2c -c public localhost|grep ^TCP-MIB::tcpListenerProcess

TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".6400 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".19625 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".28416 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".28695 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".29391 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".34307 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".50944 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."1.0.0.127".30466 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."1.0.0.127".40016 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."1.0.0.127".42319 = Gauge32: 0

TCP-MIB::tcpListenerProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00".5632
= Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00".28695
= Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:01:00:00:00".40016
= Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:01:00:00:00".42319
= Gauge32: 0


There are at least 3 problems:

1) byte order problem in port representation:
5632 = 0x1600 -> 0x0016 = 22


2) address representation problem IPv6
Is:
"00:00:00:00:00:00:00:00:00:00:00:00:01:00:00:00"

should:
"00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01"

3) address representation problem IPv4
Is: "1.0.0.127"
Should: "127.0.0.1"

BTW: for UDP, the port is ok, but the address is broken in
udpEndpointProcess.ipv4 while correct in udpLocalAddress. Can't currently check
udpEndpointProcess.ipv6

$ snmpwalk -v 2c -c public localhost|grep ^UDP-MIB
UDP-MIB::udpLocalAddress.0.0.0.0.111 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.123 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.161 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.631 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.734 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.1194 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.32768 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.32769 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.32770 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.32771 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.127.0.0.1.123 = IpAddress: 127.0.0.1
UDP-MIB::udpLocalPort.0.0.0.0.111 = INTEGER: 111
UDP-MIB::udpLocalPort.0.0.0.0.123 = INTEGER: 123
UDP-MIB::udpLocalPort.0.0.0.0.161 = INTEGER: 161
UDP-MIB::udpLocalPort.0.0.0.0.631 = INTEGER: 631
UDP-MIB::udpLocalPort.0.0.0.0.734 = INTEGER: 734
UDP-MIB::udpLocalPort.0.0.0.0.1194 = INTEGER: 1194
UDP-MIB::udpLocalPort.0.0.0.0.32768 = INTEGER: 32768
UDP-MIB::udpLocalPort.0.0.0.0.32769 = INTEGER: 32769
UDP-MIB::udpLocalPort.0.0.0.0.32770 = INTEGER: 32770
UDP-MIB::udpLocalPort.0.0.0.0.32771 = INTEGER: 32771
UDP-MIB::udpLocalPort.127.0.0.1.123 = INTEGER: 123
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".111.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".123.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".161.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".631.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".734.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".1194.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".32768.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".32769.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".32770.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."0.0.0.0".32771.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv4."1.0.0.127".123.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00".123.ipv6."".0.0
= Gauge32: 0

Looks like net-snmp developers need a improved regression test system ;-)


This should be all fixed before FC6-test2 would be released! Because I don't
like to see this buggy net-snmp MIB representation in RHEL5 later...

Comment 1 Radek Vokál 2006-08-30 09:37:26 UTC
Fixed in rawhide .. Peter, I'd be more than glad if you can test my patch.

Comment 2 Peter Bieringer 2006-08-30 10:03:39 UTC
Is there any other URL for rawhide than:
ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/source/SRPMS/
or is there a push delay, because here, only version from Aug, 23 exists.

Comment 3 Peter Bieringer 2006-08-31 13:03:36 UTC
Looking good now:

TCP-MIB::tcpListenerProcess.ipv4."127.0.0.1".631 = Gauge32: 0

=> IPv4 and port ok

TCP-MIB::tcpListenerProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01".20389
= Gauge32: 0

=> IPv6 and port ok

UDP-MIB::udpEndpointProcess

=> can't check, completly missing now (IPv4 and IPv6), don't now why, but that
means that UDP IPv6 listen ports are no longer shown:

# netstat -nlpu
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address               Foreign Address            
State       PID/Program name
udp        0      0 0.0.0.0:32768               0.0.0.0:*                      
        1404/rpc.statd
udp        0      0 0.0.0.0:32769               0.0.0.0:*                      
        -
udp        0      0 0.0.0.0:32770               0.0.0.0:*                      
        1828/cups-polld
udp        0      0 0.0.0.0:161                 0.0.0.0:*                      
        24073/snmpd
udp        0      0 0.0.0.0:732                 0.0.0.0:*                      
        1404/rpc.statd
udp        0      0 0.0.0.0:111                 0.0.0.0:*                      
        1386/portmap
udp        0      0 0.0.0.0:631                 0.0.0.0:*                      
        1827/cupsd
udp        0      0 10.3.62.6:123               0.0.0.0:*                      
        1534/ntpd
udp        0      0 127.0.0.1:123               0.0.0.0:*                      
        1534/ntpd
udp        0      0 0.0.0.0:123                 0.0.0.0:*                      
        1534/ntpd
udp        0      0 :::123                      :::*                           
        1534/ntpd


# snmpwalk -v 2c -c public localhost |grep ^UDP
UDP-MIB::udpLocalAddress.0.0.0.0.111 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.123 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.161 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.631 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.732 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.32768 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.32769 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.32770 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.0.0.0.0.32809 = IpAddress: 0.0.0.0
UDP-MIB::udpLocalAddress.192.0.2.6.123 = IpAddress: 192.0.2.6
UDP-MIB::udpLocalAddress.127.0.0.1.123 = IpAddress: 127.0.0.1
UDP-MIB::udpLocalPort.0.0.0.0.111 = INTEGER: 111
UDP-MIB::udpLocalPort.0.0.0.0.123 = INTEGER: 123
UDP-MIB::udpLocalPort.0.0.0.0.161 = INTEGER: 161
UDP-MIB::udpLocalPort.0.0.0.0.631 = INTEGER: 631
UDP-MIB::udpLocalPort.0.0.0.0.732 = INTEGER: 732
UDP-MIB::udpLocalPort.0.0.0.0.32768 = INTEGER: 32768
UDP-MIB::udpLocalPort.0.0.0.0.32769 = INTEGER: 32769
UDP-MIB::udpLocalPort.0.0.0.0.32770 = INTEGER: 32770
UDP-MIB::udpLocalPort.0.0.0.0.32809 = INTEGER: 32809
UDP-MIB::udpLocalPort.192.0.2.6.123 = INTEGER: 123
UDP-MIB::udpLocalPort.127.0.0.1.123 = INTEGER: 123


Comment 4 Robert Story 2006-09-01 17:26:38 UTC
Did you test this patch on PPC? I think it fixes x86 at the expense of PPC.

At any rate, there is a proposed patch in the upstream clone of this bug report.
Please test it (ppc/x86, and 64bit counterparts, if possible), and report back
on the upstream bug, and I can apply it to upstream cvs.

Comment 5 Peter Bieringer 2006-09-01 20:09:01 UTC
For me, I can only test this on 32bit i686 hosts. If you point me to the
upstream patch, I can test this one instead of the one provided by RH.

Comment 6 Robert Story 2006-09-01 23:55:33 UTC
Sorry, I thought radek had already posted the link... it's here:

http://sourceforge.net/tracker/index.php?func=detail&aid=1534378&group_id=12694&atid=112694


Comment 7 Peter Bieringer 2006-09-07 11:47:35 UTC
The version I've tested for
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=200255#c3 was the following:

$ rpm -qlp net-snmp-5.3.1.0-6.fc6.src.rpm
net-snmp-5.0.6-libtool.patch
net-snmp-5.0.6-syslog.patch
net-snmp-5.0.8-ipv6-sock-close.patch
net-snmp-5.0.8-readonly.patch
net-snmp-5.1-async-getnext.patch
net-snmp-5.1.1-pie.patch
net-snmp-5.1.2-dir-fix.patch
net-snmp-5.2.1-file_offset.patch
net-snmp-5.3-proc_if_inet6.patch
net-snmp-5.3-size_t.patch
net-snmp-5.3.0.1-maxsensors.patch
net-snmp-5.3.1-64bit.patch
net-snmp-5.3.1-byteorder.patch
net-snmp-5.3.1-config_libdir.patch
net-snmp-5.3.1-lm_sensors.patch
net-snmp-5.3.1-multilib.patch
net-snmp-5.3.1-retrans_time.patch
net-snmp-5.3.1.tar.gz
net-snmp-5.3_vendorperl.patch
net-snmp-config
net-snmp-config.h
net-snmp.redhat.conf
net-snmp.spec
net-snmpd.init
net-snmpd.logrotate
net-snmptrapd.init
ucd-snmp-4.2.4.pre3-mnttab.patch
ucd5820stat

It contains already the byteorder patch available at
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=200255#c6

"diff" shows me, that they are equal.

So where is the problem now?

BTW: is there any information about why "UDP-MIB::udpEndpointProcess" missing in
this version?

Comment 8 Radek Vokál 2006-09-07 11:57:30 UTC
no, the patch you was asked to test is tcp-udp-mib-byteorder-5.3.1.pat from sf.
I went through that patch and included it in net-snmp-5.3.1-7 replacing the
current byteorder patch.

Comment 9 Peter Bieringer 2006-09-07 14:38:06 UTC
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".25 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00".22
= Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv6."00:00:00:00:00:00:00:00:00:00:ff:ff:7f:00:00:01".57443
= Gauge32: 0

-> TCP-MIB::tcpListenerProcess.ipv{4,6}: ok

TCP-MIB::tcpConnectionState.ipv4."192.0.2.2".1022.ipv4."192.0.2.1".2049 =
INTEGER: established(5)
TCP-MIB::tcpConnectionState.ipv6."20:01:0d:b8:00:00:00:00:02:01:03:ff:fe:01:23:45".58959.ipv6."20:01:0d:b8:00:00:00:00:00:00:00:00:01:64:00:01".22
= INTEGER: established(5)

-> TCP-MIB::tcpConnectionState.ipv{4,6}: ok


UDP-MIB::udpEndpointProcess.ipv4."127.0.0.1".123.ipv4."".0.0 = Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00".123.ipv6."".0.0
= Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01".500.ipv6."".0.0
= Gauge32: 0

UDP-MIB::udpEndpointProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01".500.ipv6."".32851.0
= Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01".32851.ipv6."".500.0
= Gauge32: 0

-> UDP-MIB::udpEndpointProcess.ipv{4,6}: MISSING ENDPOINT

Example:

Server side: nc -6 -l -u ::1 500
Client side: nc -6 -u ::1 500

# LC_ALL=C netstat -un
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
udp        0      0 ::1:32853                   ::1:500                    
ESTABLISHED
udp        0      0 ::1:500                     ::1:32853                  
ESTABLISHED

UDP-MIB::udpEndpointProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01".500.ipv6."".32853.0
= Gauge32: 0
UDP-MIB::udpEndpointProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01".32853.ipv6."".500.0
= Gauge32: 0


-> Missing content in ""