iproute2/misc
David Ahern 930d3f2819 ss: Fix support for device filter by index
Support was recently added for device filters. The intent was to allow
the device to be specified by name or index, and using the if%u format
(dev == if5) or the simpler and more intuitive index alone (dev == 5).
The latter case is broken since the index is not saved to the filter
after the strtoul conversion. Further, the tmp variable used for the
conversion shadows another variable used in the function. Fix both.

With this change all 3 variants work as expected:
$ ss -t 'dev == 62'
State   Recv-Q Send-Q         Local Address:Port    Peer Address:Port
ESTAB       0      224         10.0.1.3%mgmt:ssh   192.168.0.50:58442

$ ss -t 'dev == mgmt'
State   Recv-Q Send-Q         Local Address:Port    Peer Address:Port
ESTAB       0      224         10.0.1.3%mgmt:ssh   192.168.0.50:58442

$ ss -t 'dev == if62'
State   Recv-Q Send-Q         Local Address:Port    Peer Address:Port
ESTAB       0      36          10.0.1.3%mgmt:ssh   192.168.0.50:58442

Fixes: 2d29321256 ("ss: Add support to filter on device")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
2016-07-20 11:55:43 -07:00
..
.gitignore Add ignore files to make using git easier 2006-08-08 12:04:38 -07:00
Makefile Make builds default to quiet mode 2016-05-31 12:13:07 -07:00
arpd.c misc: fix style issues 2016-03-21 11:56:36 -07:00
ifstat.c misc: fix style issues 2016-03-21 11:56:36 -07:00
lnstat.c misc: fix style issues 2016-03-21 11:56:36 -07:00
lnstat.h iproute2: various header include fixes for compiling with musl libc 2014-05-28 16:51:39 -07:00
lnstat_util.c misc: fix style issues 2016-03-21 11:56:36 -07:00
nstat.c Use ARRAY_SIZE macro everywhere 2016-06-29 09:18:18 -07:00
rtacct.c misc: fix style issues 2016-03-21 11:56:36 -07:00
ss.c ss: Fix support for device filter by index 2016-07-20 11:55:43 -07:00
ssfilter.h ss: Add support to filter on device 2016-06-28 12:09:01 -07:00
ssfilter.y ss: Add support to filter on device 2016-06-28 12:09:01 -07:00