Bug 829630

Summary: ss -a lists only TCP sockets
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: iprouteAssignee: Petr Šabata <psabata>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: jpopelka, psabata, pwouters, rvokal, twoerner, volga629
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-09 08:50:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
ss - change default filter to include all socket types none

Description Petr Pisar 2012-06-07 06:56:42 UTC
The `ss' tool from iproute-2.6.39-6.fc16.x86_64 has option `-a' to list sockets of all types. However it lists TCP sockets only:

root@dhcp-0-146:~ # ss -ulnp | wc -l
28
root@dhcp-0-146:~ # ss -tlnp | wc -l
22
root@dhcp-0-146:~ # ss -alnp | wc -l
22

Comment 1 Paul Wouters 2012-12-09 02:45:51 UTC
I just hit this one too :(

$ ss -lan |grep 500
$ ss -lun |grep 500
UNCONN     0      0              76.10.157.69:500                      *:*     
UNCONN     0      0              76.10.157.69:4500                     *:*

Comment 2 Paul Wouters 2012-12-09 02:56:30 UTC
The above was on Fedora with 3.6.0-2
On rhel with 2.6.32 it is worse:

[root@nohats ~]# ss -a -l -n sport = :500
Recv-Q Send-Q                      Local Address:Port                        Peer Address:Port 
[root@nohats ~]# ss -u -l -n sport = :500
Recv-Q Send-Q                      Local Address:Port                        Peer Address:Port 
[root@nohats ~]# netstat -an |grep :500
udp        0      0 127.0.0.1:500              0.0.0.0:*                               
udp        0      0 193.110.157.102:500         0.0.0.0:*                               
udp        0      0 193.110.157.104:500         0.0.0.0:*                               
udp        0      0 ::1:500                     :::*                                    
udp        0      0 2a03:6000:1004:1::102:500   :::*                                    
udp        0      0 2001:888:2003:1004::102:500 :::*                                    
udp        0      0 2a03:6000:1004:1::104:500   :::*

Comment 3 Paul Wouters 2012-12-09 03:00:25 UTC

    case 'a':
    current_filter.states = SS_ALL;
    break;
    case 'l':
    current_filter.states = (1<<SS_LISTEN) | (1<<SS_CLOSE);
    break;

(09:48:36 PM) misc: and the default filter is defined at the start of the code :
(09:48:37 PM) misc: struct filter default_filter = { .dbs    =  (1<<TCP_DB),
(09:48:44 PM) misc: and this is TCP
(09:54:50 PM) misc: in fact, ss -a do not show udp socket on my old server either
(09:55:15 PM) misc: and git log do not show change on that part ( at least, not a obvious change )

Comment 4 Petr Šabata 2012-12-11 15:40:02 UTC
(In reply to comment #2)
> The above was on Fedora with 3.6.0-2
> On rhel with 2.6.32 it is worse:
> 
> [root@nohats ~]# ss -a -l -n sport = :500
> Recv-Q Send-Q                      Local Address:Port                       
> Peer Address:Port 
> [root@nohats ~]# ss -u -l -n sport = :500
> Recv-Q Send-Q                      Local Address:Port                       
> Peer Address:Port 
> [root@nohats ~]# netstat -an |grep :500
> udp        0      0 127.0.0.1:500              0.0.0.0:*                    
> 
> udp        0      0 193.110.157.102:500         0.0.0.0:*                   
> 
> udp        0      0 193.110.157.104:500         0.0.0.0:*                   
> 
> udp        0      0 ::1:500                     :::*                        
> 
> udp        0      0 2a03:6000:1004:1::102:500   :::*                        
> 
> udp        0      0 2001:888:2003:1004::102:500 :::*                        
> 
> udp        0      0 2a03:6000:1004:1::104:500   :::*

This is fixed in 2.6.32-21.el6 (bug #811219).

Comment 5 Petr Šabata 2012-12-11 15:45:08 UTC
The current behavior, although different from netstat, is in line with ss documentation which just says 'all' lists both listening and non-listening sockets.  The socket type defaults to TCP in ss, as pointed out in comment #3.

I understand users expect netstat's behavior here, as ss is more or less its replacement.

Comment 6 Petr Šabata 2012-12-11 16:44:13 UTC
Created attachment 661551 [details]
ss - change default filter to include all socket types

Submitted upstream.

Comment 7 Fedora Update System 2012-12-12 12:04:28 UTC
iproute-3.6.0-4.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/iproute-3.6.0-4.fc18

Comment 8 Fedora Update System 2012-12-12 12:08:59 UTC
iproute-3.3.0-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/iproute-3.3.0-3.fc17

Comment 9 Fedora Update System 2012-12-12 12:09:50 UTC
iproute-2.6.39-7.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/iproute-2.6.39-7.fc16

Comment 10 Fedora Update System 2012-12-12 20:43:48 UTC
Package iproute-3.6.0-4.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing iproute-3.6.0-4.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-20265/iproute-3.6.0-4.fc18
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2012-12-20 17:03:43 UTC
iproute-3.6.0-5.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/iproute-3.6.0-5.fc18

Comment 12 Fedora Update System 2012-12-20 17:11:16 UTC
iproute-3.3.0-5.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/iproute-3.3.0-5.fc17

Comment 13 Fedora Update System 2012-12-20 17:12:27 UTC
iproute-2.6.39-8.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/iproute-2.6.39-8.fc16

Comment 14 Fedora Update System 2013-01-09 08:50:30 UTC
iproute-3.3.0-5.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2013-01-09 08:52:34 UTC
iproute-2.6.39-8.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2013-01-11 23:51:37 UTC
iproute-3.6.0-5.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.