Commit Graph

230 Commits

Author SHA1 Message Date
vadimk
eef43b5052 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>
2014-11-29 11:13:38 -08:00
Eric Dumazet
e557212eda 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>
2014-10-29 22:43:04 -07:00
Daniel Borkmann
907e1aca5f 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>
2014-10-29 22:37:45 -07:00
Eric Dumazet
624a06e63f 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>
2014-10-09 08:24:01 -07:00
Eric Dumazet
eb6028b263 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>
2014-06-09 12:36:49 -07:00
Richard Haines
116ac9270b 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>
2014-03-10 13:20:49 -07:00
FX Le Bail
7c8a3cfba0 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>
2014-02-17 10:44:16 -08:00
Pavel Emelyanov
77a8ca8118 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>
2014-02-10 14:47:54 -08:00
Masatake YAMATO
56dee73ea1 ss: add unix_seqpacket to the help message and the man page
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2014-01-09 23:05:26 -08:00
Masatake YAMATO
0d2e01c5ee 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>
2014-01-09 23:05:26 -08:00
Masatake YAMATO
30b669d7ac 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>
2014-01-09 23:05:26 -08:00
Stephen Hemminger
d2468da0a3 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>
2013-12-20 08:24:44 -08:00
Andreas Henriksson
2a4fa1c305 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>
2013-11-22 17:09:10 -08:00
Eric Dumazet
260804f422 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>
2013-06-25 13:33:07 -07:00
Andrey Vagin
ecb928c876 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>
2013-06-05 08:54:35 -07:00
Andrey Vagin
f271fe011a 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>
2013-06-05 08:54:35 -07:00
Andrey Vagin
129709aea1 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>
2013-06-05 08:54:35 -07:00
Andrey Vagin
d8402b9641 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>
2013-06-05 08:54:35 -07:00
Rami Rosen
b0f01cf60e 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>
2013-05-24 08:11:01 -07:00
Pavel Emelyanov
5b81604753 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>
2013-05-17 08:46:51 -07:00
Nicolas Dichtel
372c30d2aa 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>
2013-05-17 08:42:34 -07:00
Eric Dumazet
9cb1eccf69 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>
2013-05-03 20:48:30 -07:00
Hannes Frederic Sowa
51ff9f2453 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>
2013-02-26 17:33:49 -08:00
Stephen Hemminger
5048f9a0c5 ss: use rta_getattr_u32 2013-02-26 17:32:58 -08:00
Hannes Frederic Sowa
defd61ca91 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>
2013-02-26 17:29:24 -08:00
Stephen Hemminger
d1f28cf181 ip: make local functions static 2013-02-12 11:38:35 -08:00
Petr Sabata
7de7e5915a 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>
2012-12-11 09:50:39 -08:00
Andreas Henriksson
2c389b0f31 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>
2012-11-12 08:50:15 -08:00
Pavel Emelyanov
346f8ca814 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>
2012-10-26 17:48:49 -07:00
Pavel Emelyanov
886d19d6c9 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>
2012-10-26 17:48:49 -07:00
Pavel Emelyanov
746a695f86 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>
2012-10-26 17:48:49 -07:00
Pavel Emelyanov
3fe5b534fe 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>
2012-10-26 17:48:48 -07:00
Eric Dumazet
c6d6c92c2c 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>
2012-08-01 16:16:43 -07:00
Ben Hutchings
4d35434771 ss: Report MSS from internal TCP information
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-31 14:06:51 -07:00
Shan Wei
910b039771 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>
2012-05-03 08:27:28 -07:00
Eric Dumazet
930a75f925 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.
2012-04-10 09:00:16 -07:00
Stephen Hemminger
ff24746cca Convert to use rta_getattr_ functions
User new functions (inspired by libmnl) to do type safe access
of routeing attributes
2012-04-10 08:47:55 -07:00
Stephen Hemminger
2728f598bb ss: simplify code
Rather than copy-pasting code using sendmsg/recvmsg, use the simpler
send() and recv() system calls.
2012-02-16 16:42:42 -08:00
Matt Tierney
c51577cd13 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>
2012-02-16 16:31:35 -08:00
Eric Dumazet
a3fd8e58c1 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>
2012-01-30 08:12:50 -08:00
Stephen Hemminger
f606236010 Fix unix socket diagnostic build
Get updated headers incorporated into build environment
and include required sock_diag.h.
2012-01-20 12:48:00 -08:00
Pavel Emelyanov
dfbaa90dec 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>
2012-01-20 12:43:21 -08:00
Eric Dumazet
719b958bbd 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>
2011-11-23 14:51:54 -08:00
Petr Šabata
16963ce6f0 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>
2011-11-16 09:32:20 -08:00
Thomas Jarosch
788731b320 Fix unterminated readlink() buffer usage
Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
2011-10-13 08:16:56 -07:00
Thomas Jarosch
2bcc3c1629 Fix pipe I/O stream descriptor leak in init_service_resolver()
Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
2011-10-07 11:10:03 -07:00
Petr Sabata
583de1498e iproute2: ss - fix missing parameters
Signed-off-by: Petr Sabata <contyk@redhat.com>
2011-10-06 08:25:04 -07:00
Stephen Hemminger
18445b3e92 ss: check result of readlink
Don't ignore readlink failure.
2011-06-29 15:58:37 -07:00
Eric Dumazet
df39de8d24 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>
2011-06-20 14:31:51 -07:00
Steve Fink
fbc0f876fa 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>
2010-07-31 19:31:12 -07:00
Andreas Henriksson
7a96e19977 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>
2009-12-26 10:05:27 -08:00
Eric Dumazet
daf49fd614 ss: adds a space before congestion string
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
2009-09-11 08:06:53 -07:00
Eric Dumazet
bbe3205336 ss: correct display of sk pointer
On 64bit arches, sk pointer was 32/32 reversed.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
2009-09-11 08:06:07 -07:00
Li Yewang
a37b01c1f0 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>
2008-09-17 22:05:02 -07:00
Li Yewang
f70d96a41b 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>
2008-09-17 22:05:00 -07:00
Stephen Hemminger
2d44be19cf timers are in user hz
The kernel timers are exposed in user hz not kernel hz
2008-06-20 12:40:03 -07:00
Stephen Hemminger
4c1db1310f 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).
2008-06-20 12:34:15 -07:00
Björn Steinbrink
69cae645b2 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>
2008-04-03 08:24:04 -07:00
Stephen Hemminger
77aa4d03a7 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>
2007-12-31 10:41:18 -08:00
Stephen Hemminger
ab01dbbb94 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>
2007-07-18 15:31:29 +01:00
Stephen Hemminger
e7113c61cb ss: fix issues with signed inodes
Some parts of ss were incorrectly assuming inode number was int
not unsigned.
2007-07-10 18:26:54 -07:00
Thomas Hisch
892db6942a 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>
2007-03-05 17:35:06 -08:00
Stephen Hemminger
ae665a522b Remove trailing whitespace
Go through source files and remove all trailing whitespace

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-12-05 10:10:22 -08:00
shemminger
351efcde4e Update header files to 2.6.14
Integrate support for DCCP and tcp_diag into ss
Add -batch to ip command
2005-09-01 19:21:50 +00:00
shemminger
52d5ac3fcb Fix build issues 2005-07-05 22:11:37 +00:00
shemminger
ea8fc1047d Netem support for reorder
Update include files and add support for TCP_CONG
2005-06-22 18:27:49 +00:00
osdl.net!shemminger
b9de3ecf94 typo, extra /
(Logical change 1.133)
2005-01-19 00:23:53 +00:00
osdl.net!shemminger
c3f346b00a typo in ss
(Logical change 1.132)
2005-01-18 22:31:42 +00:00
11!tgraf
ebb4e4376a tb buffer initialization is now done in the parser
(Logical change 1.129)
2005-01-18 22:11:58 +00:00
osdl.net!shemminger
64df4e3e31 Don't need this.
(Logical change 1.103)
2004-10-20 16:12:49 +00:00
osdl.net!shemminger
b4b0b7d558 ss cleanup and enable full features.
(Logical change 1.80)
2004-09-28 18:14:03 +00:00
osdl.net!shemminger
1a5bad5aa4 fix matches that got introduced by last patch
(Logical change 1.54)
2004-07-07 17:06:35 +00:00
osdl.net!shemminger
adff36d765 Cleaner way to configure
(Logical change 1.33)
2004-06-25 21:14:22 +00:00
osdl.org!shemminger
ab61159aa0 GNU long options for ss
Pick up ephermal port list from /proc/sys/net/ipv4 rather than hard coded.

(Logical change 1.23)
2004-06-09 21:30:13 +00:00
osdl.org!shemminger
d25ad2901e Allow build on 2.4
(Logical change 1.16)
2004-06-08 23:50:43 +00:00
osdl.org!shemminger
05e18118ec Cleanup display logic and add receive space values.
(Logical change 1.12)
2004-06-08 20:33:44 +00:00
osdl.org!shemminger
15a79f12cd TCPDIAG_VEGASINFO is not a #define, its an enum
(Logical change 1.7)
2004-06-04 18:39:32 +00:00
osdl.org!shemminger
7d105b5648 Build and constant cleanup
(Logical change 1.6)
2004-06-02 20:22:08 +00:00
osdl.org!shemminger
aba5acdfdb (Logical change 1.3) 2004-04-15 20:56:59 +00:00
osdl.org!shemminger
86fdf0e47b Initial revision 2004-04-15 20:56:59 +00:00