Bug 194583 - snmpd doesn't support IPv6 in TCP/UDP MIB
snmpd doesn't support IPv6 in TCP/UDP MIB
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: net-snmp (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-14 04:11 EDT by Radek Vokal
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version: 5.3.1.0-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-27 02:19:24 EDT
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 Radek Vokal 2006-06-14 04:11:47 EDT
Resurection of #194856

Description of problem:
snmpwalk doesn't show any IPv6 related entry for TCP and UDP

Version-Release number of selected component (if applicable):
net-snmp-5.3-4.2

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
3.

# LANG=C netstat -nlptu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address            
State       PID/Program name
tcp        0      0 0.0.0.0:56738               0.0.0.0:*                  
LISTEN      1392/rpc.statd
tcp        0      0 0.0.0.0:199                 0.0.0.0:*                  
LISTEN      3867/snmpd
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                  
LISTEN      1374/portmap
tcp        0      0 0.0.0.0:6000                0.0.0.0:*                  
LISTEN      1918/X
tcp        0      0 127.0.0.1:631               0.0.0.0:*                  
LISTEN      1808/cupsd
tcp        0      0 127.0.0.1:25                0.0.0.0:*                  
LISTEN      1639/master
tcp        0      0 127.0.0.1:20636             0.0.0.0:*                  
LISTEN      2162/ssh
tcp        0      0 0.0.0.0:48476               0.0.0.0:*                  
LISTEN      -
tcp        0      0 :::6000                     :::*                       
LISTEN      1918/X
tcp        0      0 :::22                       :::*                       
LISTEN      1534/sshd
tcp        0      0 ::1:20636                   :::*                       
LISTEN      2162/ssh
udp        0      0 0.0.0.0:32768               0.0.0.0:*                      
        1392/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:*                      
        1809/cups-polld
udp        0      0 0.0.0.0:161                 0.0.0.0:*                      
        3867/snmpd
udp        0      0 0.0.0.0:720                 0.0.0.0:*                      
        1392/rpc.statd
udp        0      0 0.0.0.0:111                 0.0.0.0:*                      
        1374/portmap
udp        0      0 0.0.0.0:631                 0.0.0.0:*                      
        1808/cupsd
udp        0      0 127.0.0.1:123               0.0.0.0:*                      
        1522/ntpd
udp        0      0 0.0.0.0:123                 0.0.0.0:*                      
        1522/ntpd
udp        0      0 :::123                      :::*                           
        1522/ntpd


$ snmpwalk -c public -v 2c host | grep ^TCP |grep 6000

Actual results:
TCP-MIB::tcpConnState.0.0.0.0.6000.0.0.0.0.0 = INTEGER: listen(2)
TCP-MIB::tcpConnLocalAddress.0.0.0.0.6000.0.0.0.0.0 = IpAddress: 0.0.0.0
TCP-MIB::tcpConnLocalPort.0.0.0.0.6000.0.0.0.0.0 = INTEGER: 6000
TCP-MIB::tcpConnRemAddress.0.0.0.0.6000.0.0.0.0.0 = IpAddress: 0.0.0.0
TCP-MIB::tcpConnRemPort.0.0.0.0.6000.0.0.0.0.0 = INTEGER: 

Expected results:

IPv6 related TCP and UDP entries

------- Additional Comments From rs-bugzilla-redhat@2005.revelstone.com 
2006-06-12 12:55 EST -------
The tcpConnTable is limited to IPv4 information. The newer tcpConnectionTable
and tcpListenerTable code is not enabled by default. To enable it, rebuild you
agent, including 'tcp-mib' in the mib-modules configuration.


------- Additional Comments From pb@bieringer.de  2006-06-13 08:53 EST -------
Ok, I've rebuilded current SRPMS with following patch:

@@ -150,9 +150,9 @@
        --with-logfile="/var/log/snmpd.log"             \
        --with-persistent-directory="/var/net-snmp"     \
 %ifarch %{ix86} x86_64
-       --with-mib-modules="host agentx smux ucd-snmp/lmSensors ucd-snmp/diskio"
       \
+       --with-mib-modules="host agentx smux tcp-mib udp-mib ucd-snmp/lmSensors
ucd-snmp/diskio"        \
 %else
-       --with-mib-modules="host agentx smux "  \
+       --with-mib-modules="host agentx smux tcp-mib udp-mib"   \
 %endif
 %if %{tcp_wrappers}
        --with-libwrap=%{_libdir}                       \


UDP is ok:
# LANG=C netstat -nlu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
udp        0      0 0.0.0.0:32768               0.0.0.0:*
udp        0      0 0.0.0.0:32769               0.0.0.0:*
udp        0      0 0.0.0.0:32770               0.0.0.0:*
udp        0      0 0.0.0.0:161                 0.0.0.0:*
udp        0      0 0.0.0.0:717                 0.0.0.0:*
udp        0      0 0.0.0.0:111                 0.0.0.0:*
udp        0      0 0.0.0.0:631                 0.0.0.0:*
udp        0      0 127.0.0.1:123               0.0.0.0:*
udp        0      0 0.0.0.0:123                 0.0.0.0:*
udp        0      0 :::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".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".32781.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".717.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


But TCP is broken:

# LANG=C netstat -nlt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:902                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:199                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:39271               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:6000                0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:43130               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:20636             0.0.0.0:*                   LISTEN
tcp        0      0 :::6000                     :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 ::1:20636                   :::*                        LISTEN

TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".26521 = 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".31400 = 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".6400 = 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:00:00:00:00".5632
= 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

It's a byte order problem, e.g.
26521 -> 0x6799 -> 0x9967 -> 39271
6400 -> 0x1900 -> 0x0019 -> 25

Can one provide a fix or point me to the related line (somewhere in files of
agent/mibgroup/tcp-mib/tcpListenerTable I think) and report the problem upstream
(if not already found there).

BTW: would it be possible to enable tcp-mib and udp-mib by default for future
RPM releases?


------- Additional Comments From pb@bieringer.de  2006-06-13 09:26 EST -------
There is an additional byte order problem in the IPv6 address:

tcp        0      0 ::1:20636                   :::*                        LISTEN

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

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

UDP has the same bug:
udp        0      0 ::1:12345                   :::*
UDP-MIB::udpEndpointProcess.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:01:00:00:00".12345.ipv6."".0.0
= Gauge32: 0

------- Additional Comments From pb@bieringer.de  2006-06-13 12:02 EST -------
BTW: I miss the IPv6 ICMP information, which means the values from /proc/net/snmp6. 

Code exists in 
agent/mibgroup/ip-mib/data_access/systemstats_linux.c

Is there any additional configure flag required?
Comment 1 Peter Bieringer 2006-07-26 11:28:19 EDT
Supported now in net-snmp-5.3.1.0-1, but representation is still buggy, see 
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=200255

This one can be closed imho.
Comment 2 Radek Vokal 2006-07-27 02:19:24 EDT
Closing per comment #1

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