History log of /external/iproute2/misc/ss.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d4db01bf3fe57ba65af116cfa399f89f90002ba7 13-Sep-2016 Lorenzo Colitti <lorenzo@google.com> ss: Support displaying and filtering on socket marks.

This allows the user to dump sockets with a given mark (via
"fwmark = 0x1234/0x1234" or "fwmark = 12345", etc.) , and to
display the socket marks of dumped sockets.

The relevant kernel commits are: d545caca827b ("net: inet: diag:
expose the socket mark to privileged processes.") and
- a52e95abf772 ("net: diag: allow socket bytecode filters to
match socket marks")

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>

[Backport of net-next ec75249b141e99b978e6494345d468595f5b829f]

Bug: 23113288
Change-Id: If4beb143fdb1f841c6f11e1a70a7f3dc25df1c96
/external/iproute2/misc/ss.c
fb2594c183fbedbe8f91fe7b1f7fed1331bb3194 08-Jan-2016 Lorenzo Colitti <lorenzo@google.com> ss: support closing inet sockets via SOCK_DESTROY.

This patch adds a -K / --kill option to ss that attempts to
forcibly close matching sockets using SOCK_DESTROY.

Because ss typically prints sockets instead of acting on them,
and because the kernel only supports forcibly closing some types
of sockets, the output of -K is as follows:

- If closing the socket succeeds, the socket is printed.
- If the kernel does not support forcibly closing this type of
socket (e.g., if it's a UDP socket, or a TIME_WAIT socket),
the socket is silently skipped.
- If an error occurs (e.g., permission denied), the error is
reported and ss exits.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
/external/iproute2/misc/ss.c
61170fd88d264c6a6c9d2c2f4433cdacc3385e93 28-Nov-2015 Phil Sutter <phil@nwl.cc> get rid of unnecessary fgets() buffer size limitation

fgets() will read at most size-1 bytes into the buffer and add a
terminating null-char at the end. Therefore it is not necessary to pass
a reduced buffer size when calling it.

This change was generated using the following semantic patch:

@@
identifier buf, fp;
@@
- fgets(buf, sizeof(buf) - 1, fp)
+ fgets(buf, sizeof(buf), fp)

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
d572ed4d0af79eb597469d3f1a84456782c64f24 28-Nov-2015 Phil Sutter <phil@nwl.cc> get rid of remaining -Wunused-result warnings

Although not fundamentally necessary to check return codes in these
spots, preventing the warnings will put new ones into focus.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
c29d37925aa479a6c0545fee87329ab1d248680a 28-Nov-2015 Phil Sutter <phil@nwl.cc> ss: review is_ephemeral()

No need to keep static port boundaries global, they are not used
directly. Keeping them local also allows to safely reduce their names to
the minimum. Assign hardcoded fallback values also if fscanf() fails.
Get rid of unnecessary braces around return parameter.

Instead of more or less duplicating is_ephemeral() in run_ssfilter(),
simply call the function instead.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
596307ea3d638ea037017b0d6f31f2d04fddd296 28-Nov-2015 Phil Sutter <phil@nwl.cc> ss: reduce max indentation level in init_service_resolver()

Exit early or continue on error instead of putting conditional into
conditional to make reading the code a bit easier.

Also, the call to memcpy() can be skipped by initialising prog with the
desired prefix.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
f73105ab42795422f131fb711712e3c860df982f 15-Oct-2015 Phil Sutter <phil@nwl.cc> ss: return -1 if an unrecognized option was given

When getopt_long encounters an option which has not been registered, it
returns '?'. React upon that and call usage() instead of help() so ss
returns with a non-zero exit status.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
0ee9052f1bc2f632b7a181aaaee28584fd82cc18 06-Oct-2015 willy tarreau <w@1wt.eu> fix "ss -p" segfaults

I've updated Jose's patch to make it slightly simpler (eg: calloc instead
of malloc+memset), and ported it to 4.2.0 which requires it as well, and
attached it to this e-mail.

I can confirm that with this patch 4.1.1 doesn't segfault on me anymore.
The commit message should be reworked I guess though everything's in it
and I didn't want to modify his description.

Can it be merged as-is or should I reword the commit message and reference
Jose as the fix reporter ? We should not let this bug live forever.

From: "j.ps@openmailbox.org" <j.ps@openmailbox.org>

Essentially all that is needed to get rid of this issue is the
addition of:

memset(u, 0, sizeof(*u));

after:

if (!(u = malloc(sizeof(*u))))
break;

Also patched some other situations (strcpy and sprintf uses) that
potentially produce the same results.

Signed-off-by: Jose P Santos <j.ps@openmailbox.org>

[ wt: made Jose's patch slightly simpler, all credits to him for the diag ]
Signed-off-by: Willy Tarreau <w@1wt.eu>
/external/iproute2/misc/ss.c
a8e35427fb14a2275221a1c920b640d9794f9e69 24-Sep-2015 Dan Webster <dsw@hexology.net> ss: fix file-based filtering segfault

Commit 1527a17 introduced a change where the second of two ssfilter_parse()
calls in ss.c was moved outside of a conditional block (ss.c: ~3575). This
commit enabled the parsing of services, such as 'sport = :ssh', but
inadvertently broke the '-F' file-based filtering:
/external/iproute2/misc/ss.c
4fcfb6bc71f39039271b9f00d4044a9a2a97a0a3 26-Aug-2015 Mike Saal <msaal@qacafe.com> ss format bug

Hi:

I found a formatting bug in the 4.1.1 ss command. The following line was
incorrectly output due to passing a negative length to printf() when
displaying the local address. In this instance hostapd does a "bind to
device" on cdreth0 and then does a udp "in address any" port 67 bind.
Please note the whitespace between the '*' and ' %cdreth0:67'

'udp UNCONN 0 0 ** %cdreth0:67* *:* users:(("hostapd",pid=19241,fd=5))'

Attached is my patch for the bug fix, it might be prudent to add more
guard code looking for negative length format codes.

Sincerely, Mike
/external/iproute2/misc/ss.c
a02371fb3831c8d3d9d53209f2389b250a1fb804 06-Aug-2015 Phil Sutter <phil@nwl.cc> misc/ss: fix memory leak in user_ent_hash_build()

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
b95d28c380c945ac760b128403dc82279cb9cc39 06-Aug-2015 Phil Sutter <phil@nwl.cc> misc/ss: add missing fclose() calls

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
532ca40a52d4103816f2e50690a02e9dd6c1abe5 06-Aug-2015 Phil Sutter <phil@nwl.cc> misc/ss: simplify buffer realloc, fix checking realloc failure

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
e0dce0e5dc363b7e307984706c130f6ee769259b 06-Aug-2015 Phil Sutter <phil@nwl.cc> misc/ss: avoid NULL pointer dereference

This was working before, but only if realloc a) succeeded and b) did not
move the buffer to a different location. ''**buf = **new_buf' then
writes the value of *new_buf's first field into that of *buf.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
7f9dddbe7ddf507e96b025a95e352f3b863db0d1 07-Aug-2015 Phil Sutter <phil@nwl.cc> misc/ss: don't imply -a when -A was specified

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
99bb68ff666ce493cc536ee0818f156d6699168e 21-Jul-2015 Vadim Kochan <vadim4j@gmail.com> ss: fix crash when dump stats from /proc with '-p'

It really partially reverts:

ec4d0d8a9def35 (ss: Replace unixstat struct by new sockstat struct)

but adds few fields (name & peer_name) from removed unixstat to sockstat struct to easy
return original code.

Fixes: ec4d0d8a9def35 (ss: Replace unixstat struct by new sockstat struct)
Reported-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
92de1c2c820816801681d76f5de7137a2b5996df 21-Jul-2015 Stephen Hemminger <shemming@brocade.com> remove unnecessary checks for NULL before free

Since free(NULL) is a no-op, it is safe to remove unnecesary
if checks.
/external/iproute2/misc/ss.c
235c4453471a90017bac632462c7a208ba7573e8 15-Jul-2015 Nikolay Aleksandrov <nikolay@cumulusnetworks.com> ss: fix display of raw sockets

After commit 8250bc9ff4e5 ("ss: Unify inet sockets output") raw sockets
are displayed as udp because dgram_show_line() is used for both and
thus IPPROTO_UDP is used for both so proto_name() returns "udp".
Fix this by checking dg_proto which is set according to the caller of
dgram_show_line().

Reported-by: Miha Marolt <miham@beyondsemi.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
/external/iproute2/misc/ss.c
f32dc7467fee0b9e55c3fc6e2895d62e881dec55 24-Jun-2015 Phil Sutter <phil@nwl.cc> ss: print value of IPV6_V6ONLY socket option if set

If available and set, print 'v6only:1' for AF_INET6 sockets upon request
of extended information. For IPv6 sockets bound to in6addr_any, this is
the only way to determine if they will also accept IPv4 requests or not.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/misc/ss.c
6885e3bf8efa311322b5c32936f7f6155b03a23d 17-Jun-2015 Craig Gallek <kraig@google.com> ss: Include -E option for socket destroy events

Use the IPv4/IPv6/TCP/UDP multicast groups of NETLINK_SOCK_DIAG
to filter and display socket statistics as they are destroyed.

Kernel support patch series: 24029a3603cfa633e8bc2b3fb3e48e76c497831d

Signed-off-by: Craig Gallek <kraig@google.com>
/external/iproute2/misc/ss.c
69be46c56261cd7dc1a94d4f85ac82ae3372146b 26-Jun-2015 Stephen Hemminger <shemming@brocade.com> Merge branch 'master' into net-next
ecb435eacd50161d2a7cce5731a269ef916c0dd4 26-May-2015 Craig Gallek <kraig@google.com> ss: add support for segs_in and segs_out

Two new tcp_info fields: tcpi_segs_in and tcpi_segs_out.
(2efd055c53c06b7e89c167c98069bab9afce7e59)

~: ss -ti src :22
cubic wscale:7,6 rto:201 rtt:0.244/0.012 ato:40 mss:1418 cwnd:21 bytes_acked:80605 bytes_received:20491 segs_out:414 segs_in:600 send 976.3Mbps lastsnd:23 lastrcv:23 lastack:22 pacing_rate 1952.7Mbps rcv_rtt:98 rcv_space:28960

Signed-off-by: Craig Gallek <kraig@google.com>
Reviewed-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
/external/iproute2/misc/ss.c
bbd303d183a5638be7feb952b6266a9251bce348 25-Jun-2015 Maciej Żenczykowski <maze@google.com> iproute2: misc/ss.c - fix run_ssfilter af_packet when protocol == 0

s->local.data is a pointer to a field of a non-NULL struct, and hence
cannot be NULL, thus comparing it to 0 is always false, and thus the
return is always false.

Presumably this was meant to be a check whether s->local.data[0] (which
I believe stores af_packet protocol) is 0, ie. ANY.

Change-Id: Ia232f5b06ce081e3b2fb6338f1a709cd94e03ae5
Fixes:
ss.c:1018:37: error: comparison of array 's->local.data' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
return s->lport == 0 && s->local.data == 0;
~~~~~~~~~^~~~ ~
1 error generated.
/external/iproute2/misc/ss.c
f975059a511d19658eaf73806fee821311fd59ff 25-Jun-2015 Stephen Hemminger <shemming@brocade.com> Merge branch 'master' into net-next
518af1e0b14cdc8eeac4db313767f5d1dfd1fce1 29-May-2015 Eric Dumazet <edumazet@google.com> 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>
/external/iproute2/misc/ss.c
22588a0e65428611af7f7da648fc9542d65a2a0c 29-May-2015 Eric Dumazet <edumazet@google.com> ss: speedup resolve_service()

Lets implement a full cache with proper hash table, memory got cheaper
these days.

Before :

$ time ss -t | wc -l
529678

real 0m22.708s
user 0m19.591s
sys 0m2.969s

After :

$ time ss -t | wc -l
528291

real 0m5.078s
user 0m4.099s
sys 0m0.985s

Signed-off-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/misc/ss.c
d2055ea597e571bbbb6468b23b9c85de5ebf4591 29-May-2015 Eric Dumazet <eric.dumazet@gmail.com> ss: Fix allocation of cong control alg name

On Fri, 2015-05-29 at 13:30 +0300, Vadim Kochan wrote:
> From: Vadim Kochan <vadim4j@gmail.com>
>
> Use strdup instead of malloc, and get rid of bad strcpy.
>
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
> misc/ss.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/misc/ss.c b/misc/ss.c
> index 347e3a1..a719466 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -1908,8 +1908,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
>
> if (tb[INET_DIAG_CONG]) {
> const char *cong_attr = rta_getattr_str(tb[INET_DIAG_CONG]);
> - s.cong_alg = malloc(strlen(cong_attr + 1));
> - strcpy(s.cong_alg, cong_attr);
> + s.cong_alg = strdup(cong_attr);
> }
>
> if (TCPI_HAS_OPT(info, TCPI_OPT_WSCALE)) {

I doubt TCP_CA_NAME_MAX will ever change in the kernel : 16 bytes.

Its typically "cubic" and less than 8 bytes.

Using 8 bytes to point to a malloc(8) is a waste.

Please remove the memory allocation, or store the pointer, since
tcp_show_info() does the malloc()/free() before return.
/external/iproute2/misc/ss.c
1a4dda7103bcd5efcca72ffe03eef43318897dae 11-May-2015 Eric Dumazet <edumazet@google.com> ss: add support for bytes_acked & bytes_received

tcp_info has 2 new fields : bytes_acked & bytes_received

$ ss -ti src :22
...
cubic wscale:7,6 rto:234 rtt:33.199/17.225 ato:17.225 mss:1418 cwnd:9
ssthresh:9 send 3.1Mbps lastsnd:3 lastrcv:4 lastack:193
bytes_acked:188396 bytes_received:13639 pacing_rate 6.2Mbps unacked:1
retrans:0/4 reordering:4 rcv_rtt:47.25 rcv_space:28960

Signed-off-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/misc/ss.c
2631b856668a717f076fdde94f30b128a1cd5553 15-May-2015 Vadim Kochan <vadim4j@gmail.com> ss: Show more info (ring,fanout) for packet socks

Print such info like version, tx/rx ring, fanout for
packet sockets when '-e' option was specified.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
3bf5445c5ee583309e841051dc6a9489f9f331f4 08-May-2015 Eric Dumazet <edumazet@google.com> ss: dctcp changes

Missing space before dctcp: markers.

With dctcp, cwnd=2 is pretty common, just display cwnd value even
if cwnd has this value, it makes parsing easier.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
/external/iproute2/misc/ss.c
656e8fdd2dc00c79602f5bb8567e7771d21fb692 06-May-2015 Eric Dumazet <edumazet@google.com> ss: small optim in tcp_show_info()

Kernel can give us smaller tcp_info than our.

We copy the kernel provided structure and fill with 0
the remaining part.

Lets clear only the missing part to save some cycles, as we intend to
slightly increase tcp_info size in the future.

Signed-off-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/misc/ss.c
57ff5a1096cab63107d7e85bcd0d822614e33d73 30-Apr-2015 Vadim Kochan <vadim4j@gmail.com> ss: Fix wrong filter behaviour

Fixed applying family & socket type filters.
It was not possible to select UDP & UNIX sockets together.

Now selected families are ORed.

The problem was that filters were combined by AND.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Reported-By: Mihai Moldovan <ionic@ionic.de>
/external/iproute2/misc/ss.c
2e7e805d0aac4dd7a3d66951e28c0e3f457781ae 10-Mar-2015 Eric Dumazet <edumazet@google.com> ss: better 32bit support

Socket cookies are 64bit, even if ss happens to be
a 32bit binary, running on a 64 bit host.

Signed-off-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/misc/ss.c
7871f7dbf0912500e364efdb5abfaaad531591d0 27-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Allow to specify sport/dport without ':'

Ugly change but it allows to specify sport/dport w/o ':'

# ss dport = 80 and sport = 44862

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
b5024ee1eddae64875dc761f509d0d31362788e3 24-Feb-2015 Hagen Paul Pfeifer <hagen@jauu.net> ss: group DCTCP socket statistics

Keep ss output consistent and format DCTCP socket statistics similar to skmen
and timer where a group of logical values are grouped by brackets. This makes
parser scripts *and* humans more happy.

Current output of 'ss -inetm dst :80':
ESTAB 0 0 192.168.11.14:55511 173.194.66.189:443
timer:(keepalive,14sec,0) uid:1000 ino:428768
sk:ffff88020ceb5b00 <-> skmem:(r0,rb372480,t0,tb87040,f0,w0,o0,bl0)
ts sack wscale:7,7 rto:250 rtt:49.225/20.837 ato:40 mss:1408 cwnd:10
ce_state 23 alpha 23 ab_ecn 23 ab_tot 23 send 2.3Mbps
lastsnd:121026 lastrcv:121026 lastack:30850 pacing_rate 4.6Mbps
retrans:0/2 rcv_rtt:40.416 rcv_space:2920

New grouped output:
ESTAB 0 0 192.168.11.14:55511 173.194.66.189:443
timer:(keepalive,14sec,0) uid:1000 ino:428768
sk:ffff88020ceb5b00 <-> skmem:(r0,rb372480,t0,tb87040,f0,w0,o0,bl0)
ts sack wscale:7,7 rto:250 rtt:49.225/20.837 ato:40 mss:1408 cwnd:10
dctcp(ce_state:23,alpha:23,ab_ecn:23,ab_tot:23) send 2.3Mbps
lastsnd:121026 lastrcv:121026 lastack:30850 pacing_rate 4.6Mbps
retrans:0/2 rcv_rtt:40.416 rcv_space:2920

Cc: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
/external/iproute2/misc/ss.c
5f24ec0e0658415c4b50578af9aa338a3902b4d8 22-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Skip filtered netlink sockets before detailed info

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
29999b0ff23d76e5d93d238a0461c59841afea73 22-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Add filter before printing unix stats from Netlink

Detailed info can be printed if filter should not pass
the socket info.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
a221d621bb4af414b974ccc40bba26481337d7cf 12-Feb-2015 Bryton Lee <brytonlee01@gmail.com> prevent the read ahead of /proc/slabinfo in ss

Signed-off-by: Bryton Lee <brytonlee01@gmail.com>
/external/iproute2/misc/ss.c
11ba90fcbddf60ce2c83f9c011fd4676e651acf7 13-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Fixed wrong tcp ato value from netlink

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
b217df108ce9ecfa13c6a8ddfd1e3ff69af9faba 13-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Unify socket address output by one generic func

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
f1b39e1bd6681af208d428e02a43ff1df3b5fb16 13-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Unify details info output:ino,uid,sk

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
2d791bc87c1243819521010cd0b4d3cbe0308236 13-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Unify state socket output:netid, state, rq, wq

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
ec4d0d8a9def3523af615f1b48fb55a247ee921d 13-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Replace unixstat struct by new sockstat struct

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
89f634f9177b5f228d78298e2e42be7a65808af8 13-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Replace pktstat struct by new sockstat struct

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
055840f27f09704d5d1003620e847058bc30089d 13-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Split tcpstap struct to sockstat & tcpstat

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
1527a17ed88fa4d1778f71e066bca1d68d5eba0a 13-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Fix filter expression parser

Seems expression parser did not work correctly some
long time and such simple things did not work too:

# ss -a '( sport = :ssh )'

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
95ce04bc86c2299ea8fd466d521ba34f930d05df 08-Feb-2015 Vadim Kochan <vadim4j@gmail.com> ss: Show stats from specified network namespace

Added new '-N NSNAME, --net=NSNAME' option to show socket stats
from the specified network namespace name.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
8250bc9ff4e55a3ef397ed8c7612f1392d164295 20-Jan-2015 Vadim Kochan <vadim4j@gmail.com> ss: Unify inet sockets output

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
db08bdb816d337102c5486744008db9c9faa43bf 20-Jan-2015 Vadim Kochan <vadim4j@gmail.com> ss: Unify meminfo output

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
f42a45747071116649d5b70d432efd2dedc280bd 08-Jan-2015 Vadim Kochan <vadim4j@gmail.com> ss: Filter inet dgram sockets with established state by default

As inet dgram sockets (udp, raw) can call connect(...) - they
might be set in ESTABLISHED state. So keep the original behaviour of
'ss' which filtered them by ESTABLISHED state by default. So:

$ ss -u

or

$ ss -w

Will show only ESTABLISHED UDP sockets by default.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
ff041f1619298375339496c6c4d1db17d2eedc86 08-Jan-2015 Vadim Kochan <vadim4j@gmail.com> ss: Usage filter state names, options alignment

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
ace5cb31b1f0f8f4e5644808234f9843409e86a6 08-Jan-2015 Vadim Kochan <vadim4j@gmail.com> ss: Fix case when UDP is printed as ipproto-xxx

When 'ss' prints UDP sockets info together with RAW sockets
e.g.:

$ ss -a

then UDP sockets are resolved as "ipproto-xxx".

It was caused that dg_proto was set after printing UDP
socket info from netlink. So fixed issue by moving
setting dg_proto before printing info from Netlink.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
9db7bf15e22b6a1b8bc09c4a1e29571cbca55c94 04-Jan-2015 Vadim Kochan <vadim4j@gmail.com> ss: Filtering logic changing, with fixes

This patch fixes some filtering combinations issues which does not
work on the 'master' version:

$ ss -4
shows inet & unix sockets, instead of only inet sockets

$ ss -u
needs to specify 'state closed'

$ ss src unix:*X11*
needs to specify '-x' shortcut for UNIX family

$ ss -A all
shows only sockets with established states

There might some other issues which was not observed.

Also changed logic for calculating families, socket types and
states filtering. I think that this version is a little simpler
one. Now there are 2 predefined default tables which describes
the following maping:

family -> (states, dbs)
db -> (states, families)

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
4a0053b606a344650d98c28af3269f60f1fb6718 04-Jan-2015 Vadim Kochan <vadim4j@gmail.com> ss: Unify packet stats output from netlink and proc

Refactored to use one func for output packet stats info
from both /proc and netlink.

Added possibility to get packet stats info from /proc
by setting environment variable PROC_ROOT or PROC_NET_PACKET.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
bf4ceee6ae0b516e4d684b60eda20efe896cab8f 04-Jan-2015 Vadim Kochan <vadim4j@gmail.com> ss: Unify unix stats output from netlink and proc

Refactored to use one func for output unix stats info
from both /proc and netlink.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
486ccd99a0b4f4d2c58546264280f1a884aa0c10 26-Dec-2014 Vadim Kochan <vadim4j@gmail.com> ss: Use rtnl_dump_filter for inet_show_netlink

Just another refactoring for ss to use rtnl API from lib

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
3d0b7439dfac96d93386295a4c961b89bd3d8463 21-Dec-2014 Stephen Hemminger <shemming@brocade.com> whitespace cleanup

Remove all trailing whitespace and space before tabs.
/external/iproute2/misc/ss.c
b9ea445d529d42fd328fd3343c51403a3672d55f 21-Dec-2014 Vadim Kochan <vadim4j@gmail.com> ss: Dont show netlink and packet sockets by default

Checking by SS_CLOSE state was remowed in:

(45a4770bc0) ss: Remove checking SS_CLOSE state for packet and netlink

which is not really correct because now by default all sockets are seen
when do 'ss'.

Here is most correct fix which considers specified family.

To see netlink sockets:
ss -A netlink

To see packet sockets:
ss -A packet

And ss by default will show only connected/established sockets as it
was before all the time.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
8a4025f6a4e182f0f33763238314ff1d96c580db 03-Dec-2014 vadimk <vadim4j@gmail.com> ss: Use rtnl_dump_filter in handle_netlink_request

Replaced handling netlink messages by rtnl_dump_filter
from lib/libnetlink.c, also:

- removed unused dump_fp arg;
- added MAGIC_SEQ #define for 123456 seq id;
- silently exit if ENOENT errno is caused for NETLINK_SOCK_DIAG proto
in lib/libnetlink.c: rtnl_duml_filter_l(...) function. This fix
was added in a3fd8e58c1787af186f5c4b234ff974544f840b6 by Eric
for misc/ss.c

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
b00daf6a839cb761e9df6bdb8dd4927a8c5b06f6 06-Dec-2014 vadimk <vadim4j@gmail.com> ss: Use nl_proto_a2n for filtering by netlink proto

Now it is posible to filter by existing Netlink protos:

ss -A netlink src uevent
ss -A netlink src nft
ss -A netlink src genl

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
d68e00f704c19aee1419c56eced3a8e8e7157e35 05-Dec-2014 vadimk <vadim4j@gmail.com> ss: Fix layout/output issues introduced by regression

This patch fixes the following issues which was introduced by me in commits:

#1 (2dc854854b7f1b) ss: Fixed broken output for Netlink 'Peer Address:Port' column
ISSUE: Broken layout when all sockets are printed out

#2 (eef43b5052afb7) ss: Identify more netlink protocol names
ISSUE: Protocol id is not printed if 'numbers only' output was specified (-n)

Also aligned the width of the local/peer ports to be more wider.

I tested with a lot of option combinations (I may miss some test cases),
but layout seems to me better than the previous released version of iproute2/ss.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
3b28be6e140e3fc2cf600f6508972afe56b4581c 29-Nov-2014 vadimk <vadim4j@gmail.com> ss: Use generic handle_netlink_request for packet

Get rid of self-handling and creating of Netlink socket for show packet
socket stats.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
5fb421d434353bd5f24d95bfd449ce3086b71423 30-Oct-2014 vadimk <vadim4j@gmail.com> ss: Refactor to use macro for define diag nl request

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
2dc854854b7f1b0a08ae496c7c4b27a107badf5e 18-Oct-2014 vadimk <vadim4j@gmail.com> ss: Fixed broken output for Netlink 'Peer Address:Port' column

When output the netlink sockets:

ss -A netlink state close

the layout is a little broken with a shifted 'Peer Address:Port'
stars and empty new lines. Fixed by making the port field to be
wider for 'Local Address:Port' column.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
45a4770bc070cc5e96762912e8f5b36d25252980 16-Oct-2014 vadimk <vadim4j@gmail.com> ss: Remove checking SS_CLOSE state for packet and netlink

I dont see a reason that packet and netlink states will be
printed only if SS_CLOSE state is set in filter, in that case
to print states of netlink or packet sockets it is needed to run:

ss -A netlink state close

instead of:

ss -A netlink

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
eef43b5052afb781852c5f56596ee439004066ab 30-Oct-2014 vadimk <vadim4j@gmail.com> ss: Identify more netlink protocol names

There were only few Netlink protocol names
which were printed on the screen:

rtnl, fw, tcpdiag

So added the ability to identify Netlink proto name
from /etc/iproute/nl_protos or from static table.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/misc/ss.c
e557212edafa069eea27022c9331fd30b9fac067 11-Oct-2014 Eric Dumazet <edumazet@google.com> netlink: extend buffers to 16K

Starting from linux-3.15 (commit 9063e21fb026, "netlink: autosize skb
lengths"), kernel is able to send up to 16K in netlink replies.

This change enables iproute2 commands to get bigger chunks,
without breaking compatibility with old kernels.

Signed-off-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/misc/ss.c
907e1aca5f6d55275d93049330a8036262233612 29-Sep-2014 Daniel Borkmann <dborkman@redhat.com> ss: output dctcp diag information

Dump useful DCTCP state/debug information gathered from diag.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
/external/iproute2/misc/ss.c
624a06e63f87b8ac7be325ee36322704545fbd85 01-Oct-2014 Eric Dumazet <edumazet@google.com> ss: add more tcp socket diagnostics

Display 4 additional tcp socket info fields :

backoff : exponential backoff
lastsnd : time in milli second since last send
lastrcv : time in milli second since last receive
lastack : time in milli second since last acknowledgement

$ ss -ti dst :22
State Recv-Q Send-Q Local Address:Port
Peer Address:Port
ESTAB 0 0 172.16.5.1:58470
172.17.131.143:ssh
cubic wscale:7,7 rto:228 rtt:30/20 ato:40 mss:1256 cwnd:6 ssthresh:4
send 2.0Mbps lastsnd:3480 lastrcv:3464 lastack:3464 rcv_rtt:81.5
rcv_space:87812

Signed-off-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/misc/ss.c
eb6028b263dc8eb0eee9ec503b9e1252825fa20f 05-Jun-2014 Eric Dumazet <edumazet@google.com> ss: display pacing_rate/max_pacing_rate

Since linux-3.15, kernel exports tcpi_pacing_rate and
tcpi_max_pacing_rate in tcp_info

Add TCP pacing_rate information on ss -i output :

lpaa23:~# ./ss -ti dst 10.246.7.151
State Recv-Q Send-Q Local Address:Port Peer Address:Port
ESTAB 0 325800 10.246.7.151:57614
10.246.7.152:46811
cubic wscale:7,7 rto:201 rtt:0.081/0.006 mss:1448 cwnd:90 ssthresh:63
send 12871.1Mbps pacing_rate 15397.8Mbps unacked:90 retrans:0/305
rcv_space:29200

If SO_MAX_PACING_RATE is set on the socket, we add /max_pacing_rate as
in :

... pacing_rate 1570.5Mbps/2.0Gbps ...

Signed-off-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/misc/ss.c
116ac9270b6d5eb0605774bcd59f0bd079865126 07-Mar-2014 Richard Haines <richard_c_haines@btinternet.com> ss: Add support for retrieving SELinux contexts

The process SELinux contexts can be added to the output using the -Z
option. Using the -z option will show the process and socket contexts (see
the man page for details).
For netlink sockets: if valid process show process context, if pid = 0
show kernel initial context, if unknown show "unavailable".

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
/external/iproute2/misc/ss.c
7c8a3cfba092af6834973ab006f8e19d6a1e3c3e 11-Feb-2014 FX Le Bail <fx.lebail@yahoo.com> ss: display interface name as zone index when needed

This change enable the ss command to display the interface name as zone index
for local addresses when needed.

For this enhanced display *_diag stuff is needed.

It is based on a first version by Bernd Eckenfels.

example:
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 0 0 fe80::20c:29ff:fe1f:7406%eth1:9999 :::*
udp UNCONN 0 0 :::domain :::*
tcp LISTEN 0 3 :::domain :::*
tcp LISTEN 0 5 fe80::20c:29ff:fe1f:7410%eth2:99 :::*

Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
/external/iproute2/misc/ss.c
77a8ca81189197e8d5e75fe19951efd0aea337d5 28-Jan-2014 Pavel Emelyanov <xemul@parallels.com> iproute: Fix Netid value for multi-families output

When requesting simultaneous output of TCP and UDP sockets
the netid field shows "tcp" always.

[root@xemvm1 iproute2]# ./misc/ss -a -tu
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp UNCONN 0 0 *:32713 *:*
tcp UNCONN 0 0 *:bootpc *:*
tcp UNCONN 0 0 :::57879 :::*
tcp LISTEN 0 128 *:ssh *:*
tcp ESTAB 0 48 1.2.3.5:ssh 1.2.3.4:45826
tcp ESTAB 0 0 1.2.3.5:ssh 1.2.3.4:45814
tcp LISTEN 0 128 :::ssh :::*

While the 1st 3 sockets are UDP ones:

[root@xemvm1 iproute2]# ./misc/ss -a -u
State Recv-Q Send-Q Local Address:Port Peer Address:Port
UNCONN 0 0 *:32713 *:*
UNCONN 0 0 *:bootpc *:*
UNCONN 0 0 :::57879 :::*

Reported-by: François-Xavier Le Bail <fx.lebail@yahoo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Tested-by: François-Xavier Le Bail <fx.lebail@yahoo.com>
/external/iproute2/misc/ss.c
56dee73ea1ab3084ba804e5afc1efe3b6cafad97 08-Jan-2014 Masatake YAMATO <yamato@redhat.com> ss: add unix_seqpacket to the help message and the man page

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/iproute2/misc/ss.c
0d2e01c5ee1a3d6ddd816cea77293ee28f99cd16 08-Jan-2014 Masatake YAMATO <yamato@redhat.com> ss: enable query by type in unix domain related socket

This patch enables -A unix_stream, -A unix_dgram and
-A unix_seqpacket option even if ss gets socket information
via netlink.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/iproute2/misc/ss.c
30b669d7ac3cc233272f0f23bc6b547a298f373e 08-Jan-2014 Masatake YAMATO <yamato@redhat.com> ss: handle seqpacket type of unix domain socket

ss didn't distignish seqpacket type from dgram type.
With this patch ss can distignish it.

$ misc/ss -x -a | grep seq
u_seq LISTEN 0 128 /run/udev/control 10966 * 0
u_seq ESTAB 0 0 * 115103 * 115104
u_seq ESTAB 0 0 * 115104 * 115103

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/external/iproute2/misc/ss.c
d2468da0a317c87ded0a9a0ae6d7d8bc7ab2e4d2 20-Dec-2013 Stephen Hemminger <stephen@networkplumber.org> check return value of rtnl_send and related functions

Use warn_unused_result to enforce checking return value of rtnl_send,
and fix where the errors are.

Suggested by initial patch from Petr Písař <ppisar@redhat.com>
/external/iproute2/misc/ss.c
2a4fa1c305742e4bfbc2960c40e0d1ee55b30694 13-Nov-2013 Andreas Henriksson <andreas@fatal.se> ss: avoid passing negative numbers to malloc

Example:

$ ss state established \( sport = :4060 or sport = :4061 or sport = :4062 or sport = :4063 or sport = :4064 or sport = :4065 or sport = :4066 or sport = :4067 \) > /dev/null
Aborted

In the example above ssfilter_bytecompile(...) will return (int)136.
char l1 = 136; means -120 which will result in a negative number
being passed to malloc at misc/ss.c:913.

Simply declare l1 and l2 as integers to avoid the char overflow.

This is one of the issues originally reported in http://bugs.debian.org/511720

Fix the same problem in other code paths as well (thanks to Eric Dumazet).

Reported-by: Andreas Schuldei <andreas@debian.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Reviewed-by: Eric Dumazet <edumazet@google.com>
/external/iproute2/misc/ss.c
260804f422fd33aa78379270d564a495b7bb5717 25-Jun-2013 Eric Dumazet <edumazet@google.com> ss: add more TCP_INFO components

Allow ss -i to display more TCP informations :

unacked:N Number of un-acked packets
retrans:X/Y X: number of outstanding retransmit packets
Y: total number of retransmits for the session
lost:N Number of lost packets (tcpi_lost)
sacked:N Number of sacked packets (tcpi_sacked)
facked:N Number of facked packets (tcpi_facked)
reordering:N Reordering level (if different of 3)

Example :

$ ss -emoi dst 10.7.7.83
tcp ESTAB 0 1154056 10.7.7.84:54127 10.7.7.83:34342
timer:(on,200ms,0) ino:57003 sk:ffff88063c51d0c0 <->
skmem:(r0,rb89280,t0,tb2097152,f726504,w1436184,o0,bl0) ts sack cubic
wscale:7,6 rto:310 rtt:107.375/1 mss:1448 cwnd:568 ssthresh:108 send
61.3Mbps unacked:568 retrans:0/21 reordering:127 rcv_space:29200

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
/external/iproute2/misc/ss.c
ecb928c876a8f21526b136d2d2b79c4cfc8b4c63 04-Jun-2013 Andrey Vagin <avagin@openvz.org> ss: Get netlink sockets info via sock-diag (v2)

v2: update netlink_diag.h

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
/external/iproute2/misc/ss.c
f271fe011aa3beb580e6efee05717597223e764c 04-Jun-2013 Andrey Vagin <avagin@openvz.org> ss: show destination address for netlink sockets

A netlink socket may be connected to a specific group.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
/external/iproute2/misc/ss.c
129709aea1b7c542e8461822c512a641496ef5ae 04-Jun-2013 Andrey Vagin <avagin@openvz.org> ss: create a function to print info about netlink sockets

It will be reused for printing info about netlink sockets, when
socket diag is used for retrieving information.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
/external/iproute2/misc/ss.c
d8402b96418748b99183d6524537ef2b0024b3dd 04-Jun-2013 Andrey Vagin <avagin@openvz.org> ss: handle socket diag request in a separate function

It will be reused to show netlink sockets

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
/external/iproute2/misc/ss.c
b0f01cf60ea9a8ce867d936be801b4f90a498b67 23-May-2013 Rami Rosen <ramirose@gmail.com> ss: replace bfp with bpf in usage().

This patch fixes usage() of misc/ss.c to use bpf instead of bfp.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
/external/iproute2/misc/ss.c
5b816047537bb04620718e798ec09ac9f7a0ad67 17-May-2013 Pavel Emelyanov <xemul@parallels.com> ss: Show inet and unix sockets' shutdown state

When extended info is requested (-e option) one will be able to observe
arrows in the output, like this:

ESTAB 0 0 127.0.0.1:41705 127.0.0.1:12345 ino:143321 sk:ffff88003a8cea00 -->
ESTAB 0 0 127.0.0.1:46925 127.0.0.1:12346 ino:143322 sk:ffff88003a8ce4c0 <--
ESTAB 0 0 127.0.0.1:51678 127.0.0.1:12347 ino:143323 sk:ffff88003a8cdf80 ---
ESTAB 0 0 127.0.0.1:46911 127.0.0.1:12348 ino:143324 sk:ffff88003b7f05c0 <->

for SHUT_RD, SHUT_WR, SHUT_RDWR and non-shutdown sockets respectively.

The respective nlattrs in *_diag messages has appeared in Linux v3.7 and
are already present in ss's headers.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
/external/iproute2/misc/ss.c
372c30d2aaaa7847b0e0554f37807355eddc58d7 17-May-2013 Nicolas Dichtel <nicolas.dichtel@6wind.com> ss: allow to retrieve AF_PACKET info via netlink

This patch add support of netlink messages for AF_PACKET and thus it allows
to get filter information of this kind of sockets.
To dump these filters info the option --bfp must be specified and the user
must have admin rights.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
/external/iproute2/misc/ss.c
9cb1eccf6910209673a7e9fc135708420db683d4 04-May-2013 Eric Dumazet <edumazet@google.com> ss: add fastopen support

ss -i can output "fastopen" attribute if socket used Fast Open

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
/external/iproute2/misc/ss.c
51ff9f2453d066933f24170f0106a7deeefa02d9 22-Feb-2013 Hannes Frederic Sowa <hannes@stressinduktion.org> ss: show socket memory stats for unix sockets if requested

The output format is the same as for tcp sockets but only the following
fields are currently non-zero: sk_rcvbuf, sk_wmem_alloc and sk_sndbuf.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
/external/iproute2/misc/ss.c
5048f9a0c508b3804d0d9449f4986681a7ec87cb 27-Feb-2013 Stephen Hemminger <stephen@networkplumber.org> ss: use rta_getattr_u32
/external/iproute2/misc/ss.c
defd61ca9191e0c93950e7ea5466682a67dcbafb 22-Feb-2013 Hannes Frederic Sowa <hannes@stressinduktion.org> ss: show send queue length on unix domain sockets

On sockets in listen state Send-Q reports the maximum backlog,
otherwise it reports allocated socket write memory.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
/external/iproute2/misc/ss.c
d1f28cf181a6f77f230d90267eef0ecfbcb25f30 12-Feb-2013 Stephen Hemminger <stephen@networkplumber.org> ip: make local functions static
/external/iproute2/misc/ss.c
7de7e5915a5492db964bc8ac48f17b1485e705d5 11-Dec-2012 Petr Sabata <contyk@redhat.com> iproute2: ss - change default filter to include all socket types

Currently the default filter lists TCP sockets only which is
rather confusing especially when the '-a/--all' flag is used.
This patch changes the default to include all sockets, imitating
netstat(8) behavior.

Signed-off-by: Petr Šabata <contyk@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
/external/iproute2/misc/ss.c
2c389b0f31ec5218d9ae4fb161232a5cbebb5cb1 10-Nov-2012 Andreas Henriksson <andreas@fatal.se> iproute2: drop libresolv

Hello!

While building the iproute package in Debian I get warnings from
package helpers like this:

dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/iproute/sbin/tc debian/iproute/usr/bin/lnstat debian/iproute/bin/ip debian/iproute/bin/ss debian/iproute/sbin/bridge debian/iproute/sbin/rtmon were not linked against libresolv.so.2 (they use none of the library's symbols)

The -lresolv in ./Makefile seems to come from pre-historic times (before
iproute2 git history, possibly from libc5/pre-glibc days).
I couldn't find out if/why there was any reason for linking to libresolv.
Does anyone know if there are any valid reasons for keeping it still?

If not, I'd be happy to see it go.... while at it I also removed includes
of <resolv.h> which I also couldn't find any reason for, but this is
just an added bonus of the patch (and there are probably more unneeded
includes that could be dropped in the same sources).

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
/external/iproute2/misc/ss.c
346f8ca81481a248a6bb0058445ab7bf3123e60b 25-Oct-2012 Pavel Emelyanov <xemul@parallels.com> ss: Get udp sockets info via sock-diag

Now everything is prepared for it, so the patch is straightforward.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
/external/iproute2/misc/ss.c
886d19d6c93546db7c093df07a71c38cda6c1694 25-Oct-2012 Pavel Emelyanov <xemul@parallels.com> ss: Support sock-diag

That is -- write the code, that sends diag request in new format. It's
mostly copied from tcp-diag code. Plus, sock-diag differentiates sockets
by families, thus we have to send two requests sequentially.

If we fail to submit new sock-diag request, try to fall-back and submit
the legacy tcp-diag one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
/external/iproute2/misc/ss.c
746a695f86b301cbee2a3c79fc490653be680b20 25-Oct-2012 Pavel Emelyanov <xemul@parallels.com> ss: Split inet_show_netlink into parts

The existing function inet_show_netlink sends tcp-diag request and
then receives back the response and prints it on the screen.

The sock-diag and legacy tcp-diag have different request types, but
report sockets in the same format. In order to support both it's
convenient to split the code into sending and receiving parts.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
/external/iproute2/misc/ss.c
3fe5b534fe61220668fb6e99c7acf325c18dff06 25-Oct-2012 Pavel Emelyanov <xemul@parallels.com> ss: Rename some tcp- names into inet-

The sock-diag is capable to diag udp sockets as well. Prepare the
ss code for this by first renaming soon-to-be-generic tcp-s names
into inet-s.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
/external/iproute2/misc/ss.c
c6d6c92c2cb5582a1368be2c759c5e73f2309bac 02-Aug-2012 Eric Dumazet <edumazet@google.com> ss: report SK_MEMINFO_BACKLOG

linux-3.6-rc1 supports SK_MEMINFO_BACKLOG with commit d594e987c6f54
(sock_diag: add SK_MEMINFO_BACKLOG)

ss command can display it if provided by the kernel.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Vijay Subramanian <subramanian.vijay@gmail.com>
/external/iproute2/misc/ss.c
4d35434771b3f943b03949db2fcde3f5fc086de7 30-Jul-2012 Ben Hutchings <bhutchings@solarflare.com> ss: Report MSS from internal TCP information

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
/external/iproute2/misc/ss.c
910b039771dd655e53bccaea6e82735718ab4e61 03-May-2012 Shan Wei <shanwei88@gmail.com> ss: use new INET_DIAG_SKMEMINFO option to get more memory information for tcp socket

INET_DIAG_SKMEMINFO is used to monitor socket memory information
which contains more information than INET_DIAG_MEMINFO.

-m option is retained for old kernel that don't surpport INET_DIAG_SKMEMINFO.

Signed-off-by: Shan Wei <davidshan@tencent.com>
/external/iproute2/misc/ss.c
930a75f9257a3e00fcfede94de5a4516fe34bd22 10-Apr-2012 Eric Dumazet <eric.dumazet@gmail.com> Fix ss if INET_DIAG not enabled in kernel

If kernel doesn't have INET_DIAG and using newish version of iproute
nothing would be displayed.
/external/iproute2/misc/ss.c
ff24746cca1ef0c92d46614158e6672acd6b63d3 10-Apr-2012 Stephen Hemminger <shemminger@vyatta.com> Convert to use rta_getattr_ functions

User new functions (inspired by libmnl) to do type safe access
of routeing attributes
/external/iproute2/misc/ss.c
2728f598bbeb6d4b7cc7f65a774ab70fdca04ab4 17-Feb-2012 Stephen Hemminger <shemminger@vyatta.com> ss: simplify code

Rather than copy-pasting code using sendmsg/recvmsg, use the simpler
send() and recv() system calls.
/external/iproute2/misc/ss.c
c51577cd133a4b569349983f2e49933d0a124a0b 16-Feb-2012 Matt Tierney <tierney@cs.nyu.edu> ss: Close file descriptors in tcp_show_netlink.

ss: Close file descriptors in tcp_show_netlink.

Signed-off-by: Matt Tierney <tierney@cs.nyu.edu>
/external/iproute2/misc/ss.c
a3fd8e58c1787af186f5c4b234ff974544f840b6 30-Jan-2012 Eric Dumazet <eric.dumazet@gmail.com> ss: should support CONFIG_INET_UDP_DIAG=n kernels

ss -x currently fails if CONFIG_INET_UDP_DIAG=n or old kernels

Also close file descriptors while we are at it.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
/external/iproute2/misc/ss.c
f6062360100ada8cbaac5b837c85c8f2f3e0765d 20-Jan-2012 Stephen Hemminger <shemminger@vyatta.com> Fix unix socket diagnostic build

Get updated headers incorporated into build environment
and include required sock_diag.h.
/external/iproute2/misc/ss.c
dfbaa90dec05d3798ad845db20e1b273ffcfcf0a 15-Dec-2011 Pavel Emelyanov <xemul@parallels.com> iproute: Dump unix sockets via netlink

Get the same info as from /proc file plus the peer inode.

Applies on top of new sock diag patch and udp diag patch.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
/external/iproute2/misc/ss.c
719b958bbdfd1cb85d4b59826c503d0982322a9d 16-Nov-2011 Eric Dumazet <eric.dumazet@gmail.com> ss: report ecnseen

Support ECNSEEN reporting in ss command.

ESTAB 0 0 10.170.73.123:4900
10.170.73.125:51001 uid:501 ino:385994 sk:f31e5f00
mem:(r0,w0,f0,t0) ts sack ecn ecnseen bic wscale:8,8 rto:210
rtt:18.75/15 ato:40 cwnd:10 send 69.9Mbps rcv_space:32768

"ecn" means TCP session negociated ECN capability (TCP layer) at setup
time

"ecnseen" at least one frame with ECT(0) or ECT(1) or ECN (IP layer) was
received from peer.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
/external/iproute2/misc/ss.c
16963ce6f01f94d1f5486008c4d73f5612beb1a6 16-Nov-2011 Petr Šabata <contyk@redhat.com> Display closed UDP sockets on 'ss -ul'

This patch emulates 'netstat -ul' behavior, showing 'closed'
(state 07) UDP sockets when ss is called with '-ul' options.
Although dirty, this seems like the least invasive way to fix
it and shouldn't really break anything.

Signed-off-by: Petr Šabata <contyk@redhat.com>
/external/iproute2/misc/ss.c
788731b320f87db9dc99638d2e3cf94bca245c6d 13-Oct-2011 Thomas Jarosch <thomas.jarosch@intra2net.com> Fix unterminated readlink() buffer usage

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
/external/iproute2/misc/ss.c
2bcc3c16293fc049e29989a2ddeffe71a1cf3910 03-Oct-2011 Thomas Jarosch <thomas.jarosch@intra2net.com> Fix pipe I/O stream descriptor leak in init_service_resolver()

Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
/external/iproute2/misc/ss.c
583de1498e05e5a826b217cc645f92ce0bd015e8 06-Oct-2011 Petr Sabata <contyk@redhat.com> iproute2: ss - fix missing parameters

Signed-off-by: Petr Sabata <contyk@redhat.com>
/external/iproute2/misc/ss.c
18445b3e92ae9c7dd7effe191200d5a1a784388b 30-Jun-2011 Stephen Hemminger <shemminger@vyatta.com> ss: check result of readlink

Don't ignore readlink failure.
/external/iproute2/misc/ss.c
df39de8d2485d24bf5e64201dae191e9ed6ccb0e 20-Jun-2011 Eric Dumazet <eric.dumazet@gmail.com> ss: fix autobound filter

Fixes following error. We currently provide garbage data to kernel, that
can abort the validation process or produce unexpected results.

$ ss -a autobound
State Recv-Q Send-Q Local Address:Port Peer Address:Port
TCPDIAG answers: Invalid argument

After patch:

$ misc/ss -a autobound
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:44624 *:*
ESTAB 0 0 192.168.1.21:47141 74.125.79.109:imaps

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
/external/iproute2/misc/ss.c
fbc0f876fa011ef5f848911bd41b3033bf418bab 09-Jun-2010 Steve Fink <sphink@gmail.com> ss -p is much too slow

> On closer inspection, it appears that ss -p does a quadratic scan. It
> rescans every entry in /proc/*/fd/* repeatedly (once per listening
> port? per process? I don't remember what I figured out.)
>
> I humbly suggest that this is not a good idea.

Yep, this is junk. Please give this patch a try:

ss: Avoid quadradic complexity with '-p'

Scan the process list of open sockets once, and store in a hash
table to be used by subsequent find_user() calls.

Reported-by: Steve Fink <sphink@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
/external/iproute2/misc/ss.c
7a96e1997782044cdb834b6c086f6287d0e641c2 07-Dec-2009 Andreas Henriksson <andreas@fatal.se> iproute: make ss --help output to stdout

Peter Palfrader said in http://bugs.debian.org/545008 that
"--help output, if explicitly requested, should go to stdout, not stderr."
which this patch fixes.

Additionally, the exit code was adjusted to success if help was
explicitly requested.

(Syntax error still outputs to stderr and has the same exit code.)

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
/external/iproute2/misc/ss.c
daf49fd614345c8ab65840075b55d04ba5774629 11-Sep-2009 Eric Dumazet <eric.dumazet@gmail.com> ss: adds a space before congestion string

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
/external/iproute2/misc/ss.c
bbe3205336e6aef488cbbef42ca9e0180df3cdbb 11-Sep-2009 Eric Dumazet <eric.dumazet@gmail.com> ss: correct display of sk pointer

On 64bit arches, sk pointer was 32/32 reversed.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
/external/iproute2/misc/ss.c
a37b01c1f00bfbde57f424eec4e7fcfcabb7acfc 09-Sep-2008 Li Yewang <lyw@cn.fujitsu.com> distinguish the inet and inet6 domain when loading the tcp_diag module

When load the tcp_diag module, and use "ss -f inet" command to show the socket
information of inet domain. But this command also shows the information of inet6
domain, but not only inet domain. and "ss -f inet6", "ss -4", "ss -6" have the
same problem.

Signed-off-by: Li Yewang <lyw@cn.fujitsu.com>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
/external/iproute2/misc/ss.c
f70d96a41bb6f825c842eff5effd708bc15df059 09-Sep-2008 Li Yewang <lyw@cn.fujitsu.com> Fix the error of "ss -f inet -t"

when using the "ss -f inet -t" command to show the tcp socket information of
inet domain, we get the error message: "ss: no socket tables to show with such filter."

This patch can fix this bug.

Signed-off-by: Li Yewang <lyw@cn.fujitsu.com>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
/external/iproute2/misc/ss.c
2d44be19cf180d2ec965680b472b8e7acec78aca 20-Jun-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> timers are in user hz

The kernel timers are exposed in user hz not kernel hz
/external/iproute2/misc/ss.c
4c1db1310f398eade7dad2e1c295cccbb7222066 20-Jun-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> use correct hz for rto,ato

The function get_hz() returns the psched hz value which is wrong
for anything other than tc usage. Should be user hz instead, but
kernel is broken (patch sent) and this code doesn't get hit on
current systems (netlink is used first).
/external/iproute2/misc/ss.c
69cae645b28edbba53c8601ddeba01430e5e9da0 03-Apr-2008 Björn Steinbrink <B.Steinbrink@gmx.de> ss: Fix return value checks for net_*_open

In ss.c, generic_proc_open(), for which the net_*_open functions are just
convenient wrappers, uses fopen, so errors are signalled by a NULL return
value. Some checks were expecting negative values instead, fix them.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
/external/iproute2/misc/ss.c
77aa4d03a7e54dc1cb40f4497a8882fb0c7deb48 31-Dec-2007 Stephen Hemminger <stephen.hemminger@vyatta.com> Use netinet/tcp.h (with correction) rather than kernel headers

Fix the userspace header file rather than importing more
kernel headers.

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
/external/iproute2/misc/ss.c
ab01dbbb94b8620c2bc85e30e107c3a9f0870a73 18-Jul-2007 Stephen Hemminger <shemminger@osdl.org> Fix ss to handle partial records.

Output from /proc may include partial records, so rather than
trying to be sexy and do own parsing, just use stdio.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
/external/iproute2/misc/ss.c
e7113c61cbba87881ec1f4c321afc313be40b1ad 11-Jul-2007 Stephen Hemminger <shemminger@linux-foundation.org> ss: fix issues with signed inodes

Some parts of ss were incorrectly assuming inode number was int
not unsigned.
/external/iproute2/misc/ss.c
892db6942ae0f5f7295b54be8d924020e99a51fc 09-Feb-2007 Thomas Hisch <t.hisch@gmail.com> Fixes use of uninitialized string

store can be used uninitialized in generic_proc_open
if getenv(env) != NULL

Signed-off-by: Thomas Hisch <t.hisch@gmail.com>
/external/iproute2/misc/ss.c
ae665a522bd46bea44c5ea84c89c8b1731954170 05-Dec-2006 Stephen Hemminger <shemminger@osdl.org> Remove trailing whitespace

Go through source files and remove all trailing whitespace

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
/external/iproute2/misc/ss.c
351efcde4e62967362a10b29f3b701cfecd7cdfc 01-Sep-2005 shemminger <shemminger> Update header files to 2.6.14
Integrate support for DCCP and tcp_diag into ss
Add -batch to ip command
/external/iproute2/misc/ss.c
52d5ac3fcb616d3e1979fb91c12213aa2a5bf75e 06-Jul-2005 shemminger <shemminger> Fix build issues
/external/iproute2/misc/ss.c
ea8fc1047d2b88ae1d123e3f79dbffbc2a3fa70c 22-Jun-2005 shemminger <shemminger> Netem support for reorder
Update include files and add support for TCP_CONG
/external/iproute2/misc/ss.c
b9de3ecf94d0c8e2b1c628e69bd8dd6afe87aad5 19-Jan-2005 osdl.net!shemminger <osdl.net!shemminger> typo, extra /

(Logical change 1.133)
/external/iproute2/misc/ss.c
c3f346b00afc6ac801d04a8c4c91778fcea621a2 18-Jan-2005 osdl.net!shemminger <osdl.net!shemminger> typo in ss

(Logical change 1.132)
/external/iproute2/misc/ss.c
ebb4e4376adddc6826695d3cab6deebb1549a605 18-Jan-2005 11!tgraf <11!tgraf> tb buffer initialization is now done in the parser

(Logical change 1.129)
/external/iproute2/misc/ss.c
64df4e3e310af45fea1ebcaaa7218294cdbf114f 20-Oct-2004 osdl.net!shemminger <osdl.net!shemminger> Don't need this.

(Logical change 1.103)
/external/iproute2/misc/ss.c
b4b0b7d5581cadca728a3ce221610d1fadf8ef7b 28-Sep-2004 osdl.net!shemminger <osdl.net!shemminger> ss cleanup and enable full features.

(Logical change 1.80)
/external/iproute2/misc/ss.c
1a5bad5aa435b1e05ff89137d86ba56f89aeea95 07-Jul-2004 osdl.net!shemminger <osdl.net!shemminger> fix matches that got introduced by last patch

(Logical change 1.54)
/external/iproute2/misc/ss.c
adff36d765a2b67f6cc2d0cacf57f160e80a0291 25-Jun-2004 osdl.net!shemminger <osdl.net!shemminger> Cleaner way to configure

(Logical change 1.33)
/external/iproute2/misc/ss.c
ab61159aa0133563b275dcddd736ebf4b87061df 09-Jun-2004 osdl.org!shemminger <osdl.org!shemminger> GNU long options for ss
Pick up ephermal port list from /proc/sys/net/ipv4 rather than hard coded.

(Logical change 1.23)
/external/iproute2/misc/ss.c
d25ad2901ebbc97244cad09c371df23874115389 09-Jun-2004 osdl.org!shemminger <osdl.org!shemminger> Allow build on 2.4

(Logical change 1.16)
/external/iproute2/misc/ss.c
05e18118ec1454e836065c52a62b6d6f30080d00 08-Jun-2004 osdl.org!shemminger <osdl.org!shemminger> Cleanup display logic and add receive space values.

(Logical change 1.12)
/external/iproute2/misc/ss.c
15a79f12cdb9a0f076837c1535cb822e376b33db 04-Jun-2004 osdl.org!shemminger <osdl.org!shemminger> TCPDIAG_VEGASINFO is not a #define, its an enum

(Logical change 1.7)
/external/iproute2/misc/ss.c
7d105b5648138bde7ad8a16302987f4cbb95062a 02-Jun-2004 osdl.org!shemminger <osdl.org!shemminger> Build and constant cleanup

(Logical change 1.6)
/external/iproute2/misc/ss.c
aba5acdfdb347d2c21fc67d613d83d4430ca3937 15-Apr-2004 osdl.org!shemminger <osdl.org!shemminger> (Logical change 1.3)
/external/iproute2/misc/ss.c
86fdf0e47be697587efcf9602cd1f952a1d73170 15-Apr-2004 osdl.org!shemminger <osdl.org!shemminger> Initial revision
/external/iproute2/misc/ss.c