]> git.ipfire.org Git - thirdparty/iproute2.git/log
thirdparty/iproute2.git
9 years agolib/namespace: don't leak fd in error case
Phil Sutter [Thu, 6 Aug 2015 12:24:35 +0000 (14:24 +0200)] 
lib/namespace: don't leak fd in error case

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agomisc/ss: add missing fclose() calls
Phil Sutter [Thu, 6 Aug 2015 12:24:34 +0000 (14:24 +0200)] 
misc/ss: add missing fclose() calls

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agomisc/ss: simplify buffer realloc, fix checking realloc failure
Phil Sutter [Thu, 6 Aug 2015 12:24:33 +0000 (14:24 +0200)] 
misc/ss: simplify buffer realloc, fix checking realloc failure

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agomisc/ss: avoid NULL pointer dereference
Phil Sutter [Thu, 6 Aug 2015 12:24:32 +0000 (14:24 +0200)] 
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>
9 years agoiplink: add ageing_time, stp_state and priority for bridge
Nikolay Aleksandrov [Wed, 12 Aug 2015 16:11:30 +0000 (09:11 -0700)] 
iplink: add ageing_time, stp_state and priority for bridge

When showing bridge attributes, show also ageing_time, stp_state and
priority if available.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
9 years agoip-link: fix a typo in help message
Zhang Shengju [Wed, 12 Aug 2015 06:29:59 +0000 (06:29 +0000)] 
ip-link: fix a typo in help message

fix a typo: "noarp" -> "arp"

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
9 years agoiplink: shortify printing the usage of link type
Zhang Shengju [Wed, 12 Aug 2015 06:03:24 +0000 (06:03 +0000)] 
iplink: shortify printing the usage of link type

Allow to print link type usage by: ip link help bridge_slave

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
9 years agoiplink: use the short format to print help info
Zhang Shengju [Wed, 12 Aug 2015 06:03:23 +0000 (06:03 +0000)] 
iplink: use the short format to print help info

Allow to print link type usage by: ip link help bridge

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
9 years agoiplink: add missing link type
Zhang Shengju [Wed, 12 Aug 2015 06:03:22 +0000 (06:03 +0000)] 
iplink: add missing link type

Add missing link type "bridge_slave".

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
9 years agoip-link: fix minor typo in manpage
Phil Sutter [Tue, 11 Aug 2015 17:14:11 +0000 (19:14 +0200)] 
ip-link: fix minor typo in manpage

Change '-human-readble' to '-human-readable'.

Signed-off-by: Phil Sutter <phil@nwl.cc>
9 years agoipnetns: make net namespace cache variable size
Stephen Hemminger [Wed, 12 Aug 2015 15:35:54 +0000 (08:35 -0700)] 
ipnetns: make net namespace cache variable size

Save some space by using variable size for nsid cache elements.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
10 years agomisc/ss: don't imply -a when -A was specified
Phil Sutter [Fri, 7 Aug 2015 13:31:27 +0000 (15:31 +0200)] 
misc/ss: don't imply -a when -A was specified

Signed-off-by: Phil Sutter <phil@nwl.cc>
10 years agotipc: fix bearer get/set help synopsis
Richard Alpe [Fri, 7 Aug 2015 07:55:09 +0000 (09:55 +0200)] 
tipc: fix bearer get/set help synopsis

One option is required for bearer set and bearer get.

10 years agoip: Preserve original portocol family in batch mode
Antti Paila [Fri, 31 Jul 2015 10:55:31 +0000 (13:55 +0300)] 
ip: Preserve original portocol family in batch mode

Reset the 'preferred_family' global variable
to its initially set value before each batch
file command is processed.

Signed-off-by: Antti Paila <antti.paila@gmail.com>
10 years agobridge fdb: add 'use' option to set NTF_USE flag in fdb add requests
Roopa Prabhu [Thu, 30 Jul 2015 21:37:02 +0000 (14:37 -0700)] 
bridge fdb: add 'use' option to set NTF_USE flag in fdb add requests

This is similar to command options corresponding to other NTF_* flags
already exposed to the user space (examples self/master).

Also updates bridge man page (The man page patch also includes
a fix to the 'self' entry and documents 'master' for fdb entries)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
10 years agobridge: drop man page fragment
Stephen Hemminger [Tue, 28 Jul 2015 23:50:19 +0000 (16:50 -0700)] 
bridge: drop man page fragment

Left over copy/paste from ip monitor man page.

10 years agoReplace BSD MAXPATHLEN by POSIX PATH_MAX
Felix Janda [Sun, 26 Jul 2015 19:25:32 +0000 (21:25 +0200)] 
Replace BSD MAXPATHLEN by POSIX PATH_MAX

Prefer using the POSIX constant PATH_MAX instead of the legacy BSD
derived MAXPATHLEN. The necessary includes for MAXPATHLEN and PATH_MAX
are <sys/param.h> and <limits.h>, respectively.

Signed-off-by: Felix Janda <felix.janda@posteo.de>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
10 years agobridge: mdb: add support for router add/del notifications monitoring
Nikolay Aleksandrov [Mon, 27 Jul 2015 11:44:05 +0000 (13:44 +0200)] 
bridge: mdb: add support for router add/del notifications monitoring

This patch adds support for ADDMDB/DELMDB notifications about router ports
which have been added or deleted/expired respectively.

Example output:
$ bridge -s monitor mdb
Deleted router port dev eth3 master br0
router port dev eth3 master br0

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
10 years agoip/ip6tunnel: fix missing return value check
Zhang Shengju [Fri, 24 Jul 2015 16:11:32 +0000 (12:11 -0400)] 
ip/ip6tunnel: fix missing return value check

Make sure that return value of each socket() call is properly checked
and do not continue processing if the call failed.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
10 years agoxfrm: remove duplicated include
Zhang Shengju [Sat, 25 Jul 2015 08:44:24 +0000 (04:44 -0400)] 
xfrm: remove duplicated include

Remove dupldated include for <linux/xfrm.h>, since it's already
included by 'xfrm.h'.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
10 years agotc: fix bpf compilation with old glibc
Nicolas Dichtel [Thu, 23 Jul 2015 07:17:41 +0000 (09:17 +0200)] 
tc: fix bpf compilation with old glibc

Error was:
f_bpf.o: In function `bpf_parse_opt':
f_bpf.c:(.text+0x88f): undefined reference to `secure_getenv'
m_bpf.o: In function `parse_bpf':
m_bpf.c:(.text+0x587): undefined reference to `secure_getenv'
collect2: error: ld returned 1 exit status

There is no special reason to use the secure version of getenv, thus let's
simply use getenv().

CC: Daniel Borkmann <daniel@iogearbox.net>
Fixes: 88eea5395483 ("tc: {f,m}_bpf: allow to retrieve uds path from env")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
10 years agoman ss: Fix explanation when no options specified
Vadim Kochan [Tue, 21 Jul 2015 13:46:28 +0000 (16:46 +0300)] 
man ss: Fix explanation when no options specified

Really by default ss dumps not only TCP sockets but any kind of socket
which is in ESTABLISHED state (TCP/UDP/UNIX).

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Reported-by: Miha Marolt <miham@beyondsemi.com>
10 years agoip: fix all the checkpatch warnings
Stephen Hemminger [Mon, 27 Jul 2015 04:46:44 +0000 (21:46 -0700)] 
ip: fix all the checkpatch warnings

Zhang Shengju some places where tabs were not being used.
Go ahead and fix all the trival checkpatch warnings in ip/ip.c
Also fix bridge.c

10 years agoss: fix crash when dump stats from /proc with '-p'
Vadim Kochan [Tue, 21 Jul 2015 17:53:19 +0000 (10:53 -0700)] 
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>
10 years agoremove unnecessary checks for NULL before free
Stephen Hemminger [Tue, 21 Jul 2015 17:49:54 +0000 (10:49 -0700)] 
remove unnecessary checks for NULL before free

Since free(NULL) is a no-op, it is safe to remove unnecesary
if checks.

10 years agoiproute2: ipa: show switch id
Jiri Pirko [Wed, 8 Jul 2015 15:08:18 +0000 (17:08 +0200)] 
iproute2: ipa: show switch id

We forgot to include this patch somehow. So do it now.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Andy Gospodarek <gospo@cumulusnetworks.com>
10 years agoss: fix display of raw sockets
Nikolay Aleksandrov [Wed, 15 Jul 2015 12:50:42 +0000 (05:50 -0700)] 
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>
10 years agoupdate kernel headers for 4.2-rc1
Stephen Hemminger [Mon, 20 Jul 2015 21:57:18 +0000 (14:57 -0700)] 
update kernel headers for 4.2-rc1

10 years agosupport batching of ip route get commands
Roopa Prabhu [Thu, 16 Jul 2015 00:06:36 +0000 (17:06 -0700)] 
support batching of ip route get commands

This patch replaces exits with returns in
ip route get command handling. This allows batching
of ip route get commands.

$cat route_get_batch.txt
route get 10.0.14.2
route get 12.0.14.2
route get 10.0.14.4

$ip -batch route_get_batch.txt
local 10.0.14.2 dev lo  src 10.0.14.2
    cache <local>
12.0.14.2 via 192.168.0.2 dev eth0  src 192.168.0.15
    cache
10.0.14.4 dev dummy0  src 10.0.14.2
    cache

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
10 years agobuild: must honor pkg-config flags for libmnl
Jan Engelhardt [Mon, 29 Jun 2015 08:01:55 +0000 (10:01 +0200)] 
build: must honor pkg-config flags for libmnl

The build otherwise fails if libmnl does not directly live in a
standard search path.

10 years agotipc: make build conditional on having libmnl
Gustavo Zacarias [Sat, 27 Jun 2015 11:15:50 +0000 (08:15 -0300)] 
tipc: make build conditional on having libmnl

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
10 years agoheaders update
Stephen Hemminger [Mon, 6 Jul 2015 21:47:26 +0000 (14:47 -0700)] 
headers update

if_tun: new ioctl value
libc-compat.h: add definitions for kernel build

10 years agoinclude: add copy of tipc.h
Michal Kubeček [Mon, 29 Jun 2015 08:53:15 +0000 (10:53 +0200)] 
include: add copy of tipc.h

Copy of kernel include/uapi/linux/tipc.h is needed to build on systems
with pre-3.16 kernel headers.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
10 years agoMerge branch 'master' into net-next
Stephen Hemminger [Fri, 26 Jun 2015 21:08:49 +0000 (14:08 -0700)] 
Merge branch 'master' into net-next

10 years agov4.1.0 v4.1.0
Stephen Hemminger [Fri, 26 Jun 2015 19:28:25 +0000 (12:28 -0700)] 
v4.1.0

10 years agotc: bpf: add initial man page
Daniel Borkmann [Thu, 21 May 2015 22:17:01 +0000 (00:17 +0200)] 
tc: bpf: add initial man page

Add a start of a man-page to the misc section as a reference and
guide on (e)BPF classifier and actions. Given that tc is only tersely
documented, this is provided in the hope that users will have an
easier getting started with tc and (e)BPF. And, that there's now more
incentive for others to also start documenting their classifier and
actions as well. ;)

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
10 years agoss: print value of IPV6_V6ONLY socket option if set
Phil Sutter [Wed, 24 Jun 2015 11:07:20 +0000 (13:07 +0200)] 
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>
10 years agoiproute2: add support to print 'linkdown' nexthop flag
Andy Gospodarek [Tue, 23 Jun 2015 17:45:38 +0000 (13:45 -0400)] 
iproute2: add support to print 'linkdown' nexthop flag

Signed-off-by: Andy Gospodaerk <gospo@cumulusnetworks.com>
Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Acked-by: Scott Feldman <sfeldma@gmail.com>
10 years agoss: Include -E option for socket destroy events
Craig Gallek [Wed, 17 Jun 2015 15:14:48 +0000 (11:14 -0400)] 
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>
10 years agoiplink_bridge: add support for priority
Nikolay Aleksandrov [Tue, 16 Jun 2015 10:38:49 +0000 (13:38 +0300)] 
iplink_bridge: add support for priority

This patch adds support to set bridge stp priority via IFLA_BR_PRIORITY.

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
10 years agoiplink_bridge: add support for stp_state
Nikolay Aleksandrov [Tue, 16 Jun 2015 10:38:48 +0000 (13:38 +0300)] 
iplink_bridge: add support for stp_state

This patch adds support to set stp_state via IFLA_BR_STP_STATE.

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
10 years agoiplink_bridge: add support for ageing_time
Nikolay Aleksandrov [Tue, 16 Jun 2015 10:38:47 +0000 (13:38 +0300)] 
iplink_bridge: add support for ageing_time

This patch adds support to set ageing_time via IFLA_BR_AGEING_TIME.

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
10 years agobonding: export 3ad actor and partner port state
Nikolay Aleksandrov [Tue, 16 Jun 2015 09:26:57 +0000 (12:26 +0300)] 
bonding: export 3ad actor and partner port state

This patch adds support to retrieve the new bond slave attributes:
IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE
IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE
which are read-only.

(Removed if_link.h changes already updated in net-next)

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
10 years agoMerge branch 'master' into net-next
Stephen Hemminger [Fri, 26 Jun 2015 04:04:04 +0000 (00:04 -0400)] 
Merge branch 'master' into net-next

10 years agoAdd displaying VF traffic statistics
Eran Ben Elisha [Tue, 16 Jun 2015 09:13:16 +0000 (12:13 +0300)] 
Add displaying VF traffic statistics

Enable reading and displaying SRIOV VFs traffic statistics through
the host PF netdevice using the nested IFLA_VF_STATS attribute.

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
10 years agompls: always set type RTN_UNICAST and scope RT_SCOPE_UNIVERSE for
Roopa Prabhu [Fri, 26 Jun 2015 03:54:27 +0000 (23:54 -0400)] 
mpls: always set type RTN_UNICAST and scope RT_SCOPE_UNIVERSE for

This patch fixes incorrect -EINVAL errors due to invalid
scope and type during mpls route deletes.

$ip -f mpls route add 100 as 200 via inet 10.1.1.2 dev swp1

$ip -f mpls route show
100 as to 200 via inet 10.1.1.2 dev swp1

$ip -f mpls route del 100 as 200 via inet 10.1.1.2 dev swp1
RTNETLINK answers: Invalid argument

$ip -f mpls route del 100
RTNETLINK answers: Invalid argument

After patch:

$ip -f mpls route show
100 as to 200 via inet 10.1.1.2 dev swp1

$ip -f mpls route del 100 as 200 via inet 10.1.1.2 dev swp1

$ip -f mpls route show

Always set type to RTN_UNICAST for mpls route add/deletes.
Also to keep things consistent with kernel set scope to
RT_SCOPE_UNIVERSE for both mpls and ipv6 routes. Both mpls and ipv6 route
deletes ignore scope.

Suggested-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
10 years agoss: add support for segs_in and segs_out
Craig Gallek [Tue, 26 May 2015 18:54:41 +0000 (14:54 -0400)] 
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>
10 years agoupdate to 4.2-pre-rc headers
Stephen Hemminger [Fri, 26 Jun 2015 02:34:26 +0000 (22:34 -0400)] 
update to 4.2-pre-rc headers

This update is to santized kernel headers from net-next.
With one change for fixing the in.h header incompatiablity
(already sent upstream).

10 years agoiplink_geneve: add tos configuration at link creation
John W. Linville [Mon, 15 Jun 2015 18:37:16 +0000 (14:37 -0400)] 
iplink_geneve: add tos configuration at link creation

Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoiplink_geneve: add ttl configuration at link creation
John W. Linville [Mon, 15 Jun 2015 18:37:15 +0000 (14:37 -0400)] 
iplink_geneve: add ttl configuration at link creation

Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoiproute2: update ip-link.8 for geneve tunnels
John W. Linville [Fri, 22 May 2015 18:46:46 +0000 (14:46 -0400)] 
iproute2: update ip-link.8 for geneve tunnels

Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agotc: {f,m}_bpf: allow to retrieve uds path from env
Daniel Borkmann [Tue, 2 Jun 2015 21:35:34 +0000 (23:35 +0200)] 
tc: {f,m}_bpf: allow to retrieve uds path from env

Allow to retrieve uds path from the environment, facilitates
also dealing with export a bit.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
10 years agotc: {f,m}_bpf: add tail call support for parser
Daniel Borkmann [Fri, 29 May 2015 13:15:44 +0000 (15:15 +0200)] 
tc: {f,m}_bpf: add tail call support for parser

Kernel commit 04fd61ab36ec ("bpf: allow bpf programs to tail-call other
bpf programs") added support for tail calls, this patch here adds tc
front end parts for the object parser to prepopulate a given eBPF prog
array before the root prog is pushed down for classifier creation. The
prepopulation works with any number of prog arrays in any dependencies,
e.g. prog or normal maps could also be used from progs that are
tail-called themself, etc.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
10 years agoconfigure: cleanup
Stephen Hemminger [Thu, 25 Jun 2015 19:10:22 +0000 (15:10 -0400)] 
configure: cleanup

Don't echo "-e" when using builtin echo in bash.

10 years agoiproute2: misc/ss.c - fix run_ssfilter af_packet when protocol == 0
Maciej Żenczykowski [Thu, 25 Jun 2015 09:03:03 +0000 (02:03 -0700)] 
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.

10 years agoiproute2: tc/m_pedit.c - remove dead code
Maciej Żenczykowski [Thu, 25 Jun 2015 09:03:02 +0000 (02:03 -0700)] 
iproute2: tc/m_pedit.c - remove dead code

The initializers are simply not needed.

These if-blocks are outright dead code, because '0 > unsigned' is always
false, so only else clause triggers and regardless of which clause triggers
it only updates 'ind' which is later unconditionally written to before
being used anyway.

Otherwise we get errors from clang:

  m_pedit.c:166:8: error: comparison of 0 > unsigned expression is always false [-Werror,-Wtautological-compare]
    if (0 > tkey->off) {
        ~ ^ ~~~~~~~~~
  m_pedit.c:209:8: error: comparison of 0 > unsigned expression is always false [-Werror,-Wtautological-compare]
    if (0 > tkey->off) {
        ~ ^ ~~~~~~~~~
  2 errors generated.

Change-Id: I3c9e9092915088fc56f992e5df736851541a4458

10 years agomroute: "ip mroute show" not working when "to" and/or "from" is given
Mazhar Rana [Thu, 11 Jun 2015 16:07:36 +0000 (21:37 +0530)] 
mroute: "ip mroute show" not working when "to" and/or "from" is given

The command "ip mroute show" is not showing routes when "to" and/or "from"
filter is applied.

root@mazhar:~# ip mroute show
(10.202.30.101, 235.1.2.3)       Iif: eth0       Oifs: eth1

But When I applied filter, it does not show anything.

root@mazhar:~# ip mroute show 235.1.2.3 from 10.202.30.101
root@mazhar:~#

Signed-off-by: Mazhar Rana <ranamazharp@gmail.com>
10 years agoFix changing tunnel remote and local address to any
Thadeu Lima de Souza Cascardo [Thu, 4 Jun 2015 12:01:18 +0000 (09:01 -0300)] 
Fix changing tunnel remote and local address to any

If a tunnel is created with a local address, you can't change it to any.

 # ip tunnel add tunl1 mode ipip remote 10.16.42.37 local 10.16.42.214 ttl 64
 # ip tunnel show tunl1
 tunl1: ip/ip  remote 10.16.42.37  local 10.16.42.214  ttl 64
 # ip tunnel change tunl1 local any
 # echo $?
 0
 # ip tunnel show tunl1
 tunl1: ip/ip  remote 10.16.42.37  local 10.16.42.214  ttl 64

It happens that parse_args zeroes ip_tunnel_parm, and when creating the
tunnel, it is OK to leave it as is if the address is any. However, when
changing the tunnel, the current parameters will be read from
ip_tunnel_parm, and local and remote address won't be zeroes anymore, so
it needs to be explicitly set to any.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 25 Jun 2015 12:01:51 +0000 (08:01 -0400)] 
Merge branch 'master' into net-next

10 years agoMerge branch 'net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shemminger...
Stephen Hemminger [Thu, 25 Jun 2015 12:01:41 +0000 (08:01 -0400)] 
Merge branch 'net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2 into net-next

10 years agotests: Add output testing
Vadim Kochan [Wed, 17 Jun 2015 21:28:18 +0000 (00:28 +0300)] 
tests: Add output testing

Added possibility to check command output by grep from the testing
script.

Now TMP_OUT & TMP_ERR are passed from Makefile and changed to
STD_ERR & STD_OUT.

Also changed some existing tests to make output testing.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agotc: util: fix print_rate for ludicrous speeds
Daniel Borkmann [Fri, 29 May 2015 19:47:45 +0000 (21:47 +0200)] 
tc: util: fix print_rate for ludicrous speeds

The for loop should only probe up to G[i]bit rates, so that we
end up with T[i]bit as the last max units[] slot for snprintf(3),
and not possibly an invalid pointer in case rate is multiple of
kilo.

Fixes: 8cecdc283743 ("tc: more user friendly rates")
Reported-by: Jose R. Guzman Mosqueda <jose.r.guzman.mosqueda@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
10 years agoss: do not bindly dump two families
Eric Dumazet [Fri, 29 May 2015 12:37:49 +0000 (05:37 -0700)] 
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>
10 years agoss: speedup resolve_service()
Eric Dumazet [Fri, 29 May 2015 11:45:48 +0000 (04:45 -0700)] 
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>
10 years agoss: Fix allocation of cong control alg name
Eric Dumazet [Fri, 29 May 2015 11:04:05 +0000 (04:04 -0700)] 
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.

10 years agoconfigure: Check for libmnl
Vadim Kochan [Fri, 29 May 2015 10:27:41 +0000 (13:27 +0300)] 
configure: Check for libmnl

Indicate existence of libmnl which is required by tipc.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agoenable transparent LFS
Mike Frysinger [Tue, 26 May 2015 06:51:30 +0000 (02:51 -0400)] 
enable transparent LFS

Make sure we use 64-bit filesystem functions everywhere.  This applies not
only to being able to read large files (which generally doesn't apply to
us), but also being able to simply stat them (as they might be using large
inodes).

Signed-off-by: Mike Frysinger <vapier@chromium.org>
10 years agopkt_cls: update header
Stephen Hemminger [Thu, 28 May 2015 16:18:28 +0000 (09:18 -0700)] 
pkt_cls: update header

Upstream changes removed some kernel only stuff from header file.

10 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 28 May 2015 16:18:01 +0000 (09:18 -0700)] 
Merge branch 'master' into net-next

Conflicts:
include/linux/tcp.h
lib/libnetlink.c

10 years agochange of rtnetlink to use RTN_F_OFFLOAD
Stephen Hemminger [Thu, 28 May 2015 01:29:02 +0000 (18:29 -0700)] 
change of rtnetlink to use RTN_F_OFFLOAD

The definition of offload flag changed during 4.1 rc process.

10 years agoupdate to 4.1-rc5 headers
Stephen Hemminger [Thu, 28 May 2015 01:27:42 +0000 (18:27 -0700)] 
update to 4.1-rc5 headers

Pull in some changes like RTN_F_EXTERNAL

10 years agolibnetlink: add size argument to rtnl_talk
Stephen Hemminger [Wed, 27 May 2015 19:26:14 +0000 (12:26 -0700)] 
libnetlink: add size argument to rtnl_talk

There have been several instances where response from kernel
has overrun the stack buffer from the caller. Avoid future problems
by passing a size argument.

Also drop the unused peer and group arguments to rtnl_talk.

10 years agogre: raising the size of the buffer holding nl messages.
Jetchko Jekov [Thu, 21 May 2015 14:32:24 +0000 (16:32 +0200)] 
gre: raising the size of the buffer holding nl messages.

Now it matches the size for the answer defined in rtnl_talk()
and prevents stack corruption with answer > 1024 bytes.

10 years agotc: gred: Add support for TCA_GRED_LIMIT attribute
David Ward [Mon, 18 May 2015 15:35:14 +0000 (11:35 -0400)] 
tc: gred: Add support for TCA_GRED_LIMIT attribute

Allow the qdisc limit to be set, which is particularly useful when
the default VQ is not configured with RED parameters.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agoxfrmmonitor: allows to monitor in several netns
Nicolas Dichtel [Wed, 20 May 2015 14:20:01 +0000 (16:20 +0200)] 
xfrmmonitor: allows to monitor in several netns

With this patch, it's now possible to listen in all netns that have an nsid
assigned into the netns where is socket is opened.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agoipmonitor: allows to monitor in several netns
Nicolas Dichtel [Wed, 20 May 2015 14:20:00 +0000 (16:20 +0200)] 
ipmonitor: allows to monitor in several netns

With this patch, it's now possible to listen in all netns that have an nsid
assigned into the netns where the socket is opened.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agoipmonitor: introduce print_headers
Nicolas Dichtel [Wed, 20 May 2015 14:19:59 +0000 (16:19 +0200)] 
ipmonitor: introduce print_headers

The goal of this patch is to avoid code duplication.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agolibnetlink: introduce rtnl_listen_filter_t
Nicolas Dichtel [Wed, 20 May 2015 14:19:58 +0000 (16:19 +0200)] 
libnetlink: introduce rtnl_listen_filter_t

There is no functional change with this commit. It only prepares the next one.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agoman: update ip monitor page
Nicolas Dichtel [Wed, 20 May 2015 14:19:57 +0000 (16:19 +0200)] 
man: update ip monitor page

Add label option.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 years agoiplink_bond: add support for ad_actor and port_key options
Jonathan Toppins [Sat, 9 May 2015 07:01:59 +0000 (00:01 -0700)] 
iplink_bond: add support for ad_actor and port_key options

This adds support for setting and displaying the following bonding
options:
* ad_user_port_key
* ad_actor_sys_prio
* ad_actor_system

Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>
10 years agocodel: add ce_threshold support to codel & fc_codel
Eric Dumazet [Mon, 11 May 2015 17:44:55 +0000 (10:44 -0700)] 
codel: add ce_threshold support to codel & fc_codel

codel & fq_codel packet schedulers are now able to have a threshold
for CE marking packets, regardless of the drop/nodrop decision taken by
CoDel.

This is particularly useful for dctcp and variants, that do not use
traditional ECN.

Note that fq_codel users would have to specify noecn if ce_threshold is
used, otherwise results would be not very interesting, as ecn is default
on for fq_codel.

$ tc -s qdisc show dev eth1
qdisc codel 8002: root refcnt 45 limit 1000p target 5.0ms ce_threshold
1.0ms interval 100.0ms
 Sent 4908469888317 bytes 3351813967 pkt (dropped 0, overlimits 0
requeues 21624365)
 rate 37671Mbit 3231836pps backlog 4904740b 250p requeues 21624365
  count 0 lastcount 0 ldelay 1.1ms drop_next 0us
  maxpacket 68130 ecn_mark 0 drop_overlimit 0 ce_mark 410861803

Signed-off-by: Eric Dumazet <edumazet@google.com>
10 years agotc: add support for Flower classifier
Jiri Pirko [Fri, 15 May 2015 11:34:04 +0000 (13:34 +0200)] 
tc: add support for Flower classifier

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
10 years agoss: add support for bytes_acked & bytes_received
Eric Dumazet [Mon, 11 May 2015 17:03:49 +0000 (10:03 -0700)] 
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>
10 years agoiproute2: GENEVE support
John W. Linville [Fri, 8 May 2015 17:27:08 +0000 (13:27 -0400)] 
iproute2: GENEVE support

Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 21 May 2015 21:52:42 +0000 (14:52 -0700)] 
Merge branch 'master' into net-next

10 years agoUpdate kernels for net-next
Stephen Hemminger [Thu, 21 May 2015 21:52:08 +0000 (14:52 -0700)] 
Update kernels for net-next

Get latest files

10 years agoss: Show more info (ring,fanout) for packet socks
Vadim Kochan [Fri, 15 May 2015 14:19:30 +0000 (17:19 +0300)] 
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>
10 years agotests: Add test for 'ip route add default'
Vadim Kochan [Tue, 12 May 2015 14:40:16 +0000 (17:40 +0300)] 
tests: Add test for 'ip route add default'

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agotests: Run each test in network namespace
Vadim Kochan [Tue, 12 May 2015 14:40:15 +0000 (17:40 +0300)] 
tests: Run each test in network namespace

Changed to forcely running each test in network
namespace to do not affect on current network setup.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
10 years agotipc: add new TIPC configuration tool
Richard Alpe [Thu, 7 May 2015 13:07:36 +0000 (15:07 +0200)] 
tipc: add new TIPC configuration tool

tipc is a user-space configuration tool for TIPC (Transparent
Inter-process Communication). It utilizes the TIPC netlink API in the
kernel to fetch data or perform actions.

The tipc tool has somewhat similar syntax to the ip tool meaning that
users of the ip tool should not feel that unfamiliar with this tool.

Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
10 years agoUpdate to latest kernel headers
Stephen Hemminger [Thu, 21 May 2015 21:39:27 +0000 (14:39 -0700)] 
Update to latest kernel headers

Also add tipc_netlink.h for later TIPC support

10 years agotc: gred: Adopt the term VQ in the command syntax and output
David Ward [Mon, 18 May 2015 15:35:13 +0000 (11:35 -0400)] 
tc: gred: Adopt the term VQ in the command syntax and output

In the GRED kernel source code, both of the terms "drop parameters"
(DP) and "virtual queue" (VQ) are used to refer to the same thing.
Each "DP" is better understood as a "set of drop parameters", since
it has values for limit, min, max, avpkt, etc. This terminology can
result in confusion when creating a GRED qdisc having multiple DPs.
Netlink attributes and struct members with the DP name seem to have
been left intact for compatibility, while the term VQ was otherwise
adopted in the code, which is more intuitive.

Use the VQ term in the tc command syntax and output (but maintain
compatibility with the old syntax).

Rewrite the usage text to be concise and similar to other qdiscs.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agotc: gred: Handle unsigned values properly in option parsing/printing
David Ward [Mon, 18 May 2015 15:35:12 +0000 (11:35 -0400)] 
tc: gred: Handle unsigned values properly in option parsing/printing

DPs, def_DP, and DP are unsigned values that are sent and received
in TCA_GRED_* netlink attributes; handle them properly when they
are parsed or printed. Use MAX_DPs as the initial value for def_DP
and DP, and fix the operator used for bounds checking them.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agotc: gred: Improve parameter/statistics output
David Ward [Mon, 18 May 2015 15:35:11 +0000 (11:35 -0400)] 
tc: gred: Improve parameter/statistics output

Make the output more consistent with the RED qdisc, and only show
details/statistics if the appropriate flag is set when calling tc.

Show the parameters used with "gred setup". Add missing statistics
"pdrop" and "other". Fix format specifiers for unsigned values.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agotc: gred: Print usage text if no arguments appear after "gred"
David Ward [Mon, 18 May 2015 15:35:10 +0000 (11:35 -0400)] 
tc: gred: Print usage text if no arguments appear after "gred"

This is more helpful to the user, since the command takes two forms,
and the message that would otherwise appear about missing parameters
assumes one of those forms.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agotc: gred: Fix whitespace issues in code
David Ward [Mon, 18 May 2015 15:35:09 +0000 (11:35 -0400)] 
tc: gred: Fix whitespace issues in code

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agotc: red: Mark "bandwidth" parameter as optional in usage text
David Ward [Mon, 18 May 2015 15:35:08 +0000 (11:35 -0400)] 
tc: red: Mark "bandwidth" parameter as optional in usage text

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agotc: red, gred: Notify when using the default value for "bandwidth"
David Ward [Mon, 18 May 2015 15:35:07 +0000 (11:35 -0400)] 
tc: red, gred: Notify when using the default value for "bandwidth"

The "bandwidth" parameter is optional, but ensure the user is aware
of its default value, to proactively avoid configuration problems.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agotc: red, gred: Fix format specifier in burst size warning
David Ward [Mon, 18 May 2015 15:35:06 +0000 (11:35 -0400)] 
tc: red, gred: Fix format specifier in burst size warning

burst is an unsigned value.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
10 years agotc: red, gred: Rename overloaded variable wlog
David Ward [Mon, 18 May 2015 15:35:05 +0000 (11:35 -0400)] 
tc: red, gred: Rename overloaded variable wlog

It is used when parsing three different parameters, only one of
which is Wlog. Change the name to make the code less confusing.

Signed-off-by: David Ward <david.ward@ll.mit.edu>