]> git.proxmox.com Git - mirror_iproute2.git/commit
ss: do not bindly dump two families
authorEric Dumazet <edumazet@google.com>
Fri, 29 May 2015 12:37:49 +0000 (05:37 -0700)
committerStephen Hemminger <shemming@brocade.com>
Thu, 25 Jun 2015 03:11:33 +0000 (23:11 -0400)
commit518af1e0b14cdc8eeac4db313767f5d1dfd1fce1
treebcb1100eaf97211bed9f2e7d8a1eb9b2b2ce857d
parent22588a0e65428611af7f7da648fc9542d65a2a0c
ss: do not bindly dump two families

ss currently dumps IPv4 sockets, then IPv6 sockets from the kernel,
even if -4 or -6 option was given. Filtering in user space then has to
drop all sockets of wrong family. Such a waste of time...

Before :

$ time ss -tn -4 | wc -l
251659

real 0m1.241s
user 0m0.423s
sys 0m0.806s

After:

$ time ss -tn -4 | wc -l
251672

real 0m0.779s
user 0m0.412s
sys 0m0.386s

Signed-off-by: Eric Dumazet <edumazet@google.com>
misc/ss.c