If I execute ss -lu
in order to view all the listening UDP sockets, then none of the sockets are displayed. If I execute ss -au
, which lists all(both listening and non-listening) UDP sockets, then "listening" sockets are displayed as UNCONN (see below).
What is the logic behind this? For example running atftpd listening for connections, should have state LISTEN not UNCONN, shouldn't it?
T60:~ # lsof -n | sed -n '1p;/UDP/p'
COMMAND PID TID USER FD TYPE DEVICE SIZE/OFF NODE NAME
avahi-dae 963 avahi 11u IPv4 9088 0t0 UDP *:mdns
avahi-dae 963 avahi 12u IPv4 9089 0t0 UDP *:44639
cupsd 1238 root 10u IPv4 8160 0t0 UDP *:ipp
dhcpcd 2072 root 7u IPv4 532052 0t0 UDP *:bootpc
dhclient6 13131 root 5u IPv6 38031 0t0 UDP *:dhcpv6-client
dhclient6 13131 root 20u IPv4 37954 0t0 UDP *:20152
dhclient6 13131 root 21u IPv6 37955 0t0 UDP *:36745
atftpd 20639 tftp 0u IPv4 344977 0t0 UDP *:tftp
netstat
T60:~ # netstat -lu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 *:bootpc *:*
udp 0 0 *:tftp *:*
udp 0 0 *:44639 *:*
udp 0 0 *:ipp *:*
udp 0 0 *:20152 *:*
udp 0 0 *:mdns *:*
udp 0 0 *:36745 *:*
udp 0 0 *:dhcpv6-client *:*
ss
T60:~ # ss -lu
Recv-Q Send-Q Local Address:Port Peer Address:Port
T60:~ # ss -ua
State Recv-Q Send-Q Local Address:Port Peer Address:Port
UNCONN 0 0 *:bootpc *:*
UNCONN 0 0 *:tftp *:*
UNCONN 0 0 *:44639 *:*
UNCONN 0 0 *:ipp *:*
UNCONN 0 0 *:20152 *:*
UNCONN 0 0 *:mdns *:*
UNCONN 0 0 :::36745 :::*
UNCONN 0 0 :::dhcpv6-client :::*
T60:~ # ss -v
ss utility, iproute2-ss110629
-ul
varies between RHEL5 and RHEL6. It is meaningless to RHEL5, but RHEL6 does what you'd expect it to. (the state is still listed asUNCONN
in the output, but it only shows the listeners) – Andrew B Oct 5 '14 at 2:50