]> git.proxmox.com Git - mirror_iproute2.git/log
mirror_iproute2.git
9 years agofix whitespace
Stephen Hemminger [Mon, 13 Apr 2015 16:39:34 +0000 (09:39 -0700)]
fix whitespace

9 years agov4.0.0
Stephen Hemminger [Mon, 13 Apr 2015 15:55:11 +0000 (08:55 -0700)]
v4.0.0

9 years agoipnetns: add a runtime check for RTM_GETNSID support
Nicolas Dichtel [Mon, 13 Apr 2015 08:34:26 +0000 (10:34 +0200)]
ipnetns: add a runtime check for RTM_GETNSID support

The goal of this patch is to test during the runtime if the command RTM_GETNSID
is supported by the kernel.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoRevert "ip netns: Fix rtnl error while print netns list"
Nicolas Dichtel [Mon, 13 Apr 2015 08:34:25 +0000 (10:34 +0200)]
Revert "ip netns: Fix rtnl error while print netns list"

This reverts commit d116ff34145b00db54a37e2a6282dccd8bc08225.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoRevert "configure: add missing INCLUDE to netnsid detection"
Nicolas Dichtel [Mon, 13 Apr 2015 08:34:24 +0000 (10:34 +0200)]
Revert "configure: add missing INCLUDE to netnsid detection"

This reverts commit d059de70cafb470f77fc19a42d95f6dc442cf6a3.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoman tc: Add description about class name option
Vadim Kochan [Wed, 8 Apr 2015 15:27:43 +0000 (18:27 +0300)]
man tc: Add description about class name option

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoconfigure: add missing INCLUDE to netnsid detection
Jiri Benc [Wed, 8 Apr 2015 19:42:00 +0000 (21:42 +0200)]
configure: add missing INCLUDE to netnsid detection

Fixes: d116ff34145b0 ("ip netns: Fix rtnl error while print netns list")
Signed-off-by: Jiri Benc <jbenc@redhat.com>
9 years agodocs: make spacing consistent
Pavel Šimerda [Tue, 7 Apr 2015 15:41:36 +0000 (08:41 -0700)]
docs: make spacing consistent

Result of the following command:

    sed -ri 's/\.  /. /g' man/*/*

Signed-Off-By: Pavel Šimerda <psimerda@redhat.com>
9 years agoman ip-link: Add missing link types - vti,ipvlan,nlmon
Vadim Kochan [Sat, 4 Apr 2015 16:00:55 +0000 (19:00 +0300)]
man ip-link: Add missing link types - vti,ipvlan,nlmon

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip-link: Align usage at [link-netns ID] line
Vadim Kochan [Sat, 4 Apr 2015 14:06:19 +0000 (17:06 +0300)]
ip-link: Align usage at [link-netns ID] line

Output of the usage was shifted be cause of missing TAB

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman ip-netns: Fix shifted layout at bottom of 'ip netns del'
Vadim Kochan [Thu, 2 Apr 2015 15:08:03 +0000 (18:08 +0300)]
man ip-netns: Fix shifted layout at bottom of 'ip netns del'

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotc class: Ignore if default class name file does not exist
Vadim Kochan [Wed, 25 Mar 2015 03:14:37 +0000 (05:14 +0200)]
tc class: Ignore if default class name file does not exist

If '-nm' specified that do not fail if there is no
default class names file in /etc/iproute2.

Changed default class name file cls_names -> tc_cls.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotc: m_bpf: fix next arg selection after tc opcode
Daniel Borkmann [Wed, 18 Mar 2015 09:13:34 +0000 (10:13 +0100)]
tc: m_bpf: fix next arg selection after tc opcode

Next argument after the tc opcode/verdict is optional, using NEXT_ARG()
requires to have another argument after that one otherwise tc will bail
out. Therefore, we need to advance to the next argument manually as done
elsewhere.

Fixes: 86ab59a6660f ("tc: add support for BPF based actions")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Pirko <jiri@resnulli.us>
9 years agoman ip-netns: Fix syntax in default ns process, indent's
Vadim Kochan [Tue, 24 Mar 2015 09:41:52 +0000 (11:41 +0200)]
man ip-netns: Fix syntax in default ns process, indent's

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman ip-link: Add ip-netns(8) in 'SEE ALSO'
Vadim Kochan [Thu, 19 Mar 2015 21:09:28 +0000 (23:09 +0200)]
man ip-link: Add ip-netns(8) in 'SEE ALSO'

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agolib utils: fix family during af_bit_len calculation
Roopa Prabhu [Wed, 18 Mar 2015 02:18:28 +0000 (19:18 -0700)]
lib utils: fix family during af_bit_len calculation

commit f3a2ddc124e0 ("lib utils: Use helpers to get AF bit/byte len")
used a wrong family or family of zero in the default case
during af_bit_len calculation causing ip route commands to
fail with below error

Error: an inet prefix is expected rather than "10.0.2.14/24".

Reported-by: Sven-Haegar Koch <haegar@sdinet.de>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
9 years agoxfrm: Fix -o (oneline) being broken in xfrm and correct mark radix
philipp@redfish-solutions.com [Thu, 19 Mar 2015 19:54:28 +0000 (13:54 -0600)]
xfrm: Fix -o (oneline) being broken in xfrm and correct mark radix

Don't insert newline in -o (oneline) mode; print mark as hex.

Oneline mode is supposed to force all output to be on oneline and
machine-parsable, but this isn't the case for "ip xfrm" as shown:

% ip -o xfrm monitor
...
src 0.0.0.0/0 dst 0.0.0.0/0 \   dir out priority 2051 ptype main \  mark -1879048191/0xffffffff
    tmpl src 203.0.130.10 dst 198.51.130.30\        proto esp reqid 16384 mode tunnel\
...

as that's 2 lines, not one. Also, the "mark" is shown in signed
decimal, but the mask is in hex. This is confusing: let's use
hex for both.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
9 years agofix ip -force -batch to continue on errors
Roopa Prabhu [Wed, 18 Mar 2015 02:26:32 +0000 (19:26 -0700)]
fix ip -force -batch to continue on errors

This patch replaces exits with returns in several
iproute2 commands. This fixes `ip -batch -force`
to not exit but continue on errors.

$cat c.txt
route del 1.2.3.0/24 dev eth0
route del 1.2.4.0/24 dev eth0
route del 1.2.5.0/24 dev eth0
route add 1.2.3.0/24 dev eth0

$ip -force -batch c.txt
RTNETLINK answers: No such process
Command failed c.txt:2
RTNETLINK answers: No such process
Command failed c.txt:3

Reported-by: Sven-Haegar Koch <haegar@sdinet.de>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
9 years agobridge: drop reference to unused option embedded from manpage
Andy Gospodarek [Tue, 17 Mar 2015 15:34:10 +0000 (11:34 -0400)]
bridge: drop reference to unused option embedded from manpage

While looking at the manpage, I noticed a reference to 'embedded' that was
added by this commit:

commit d611682a8c8f28205158e6d3a7d5e2d01db022cc
Author: John Fastabend <john.r.fastabend@intel.com>
Date:   Thu Sep 13 23:50:36 2012 -0700

    iproute2: bridge: finish removing replace option in man pages

I no longer see any reference to the 'embedded' option in any c- or h-files, so
it seems worthwhile to remove.

Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
CC: John Fastabend <john.r.fastabend@intel.com>
9 years agoip: Make uniform the use of synonyms list, show and lst
Mark Einon [Mon, 16 Mar 2015 09:59:09 +0000 (09:59 +0000)]
ip: Make uniform the use of synonyms list, show and lst

Where used in the ip tool, the 'show' option always has the synonyms
'list' and 'lst', except for ip-token and ip-addrlabel, which are missing
'lst'. Add this as a synonym for these commands.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
9 years agotc class: Show class names from file
Vadim Kochan [Tue, 3 Mar 2015 16:41:18 +0000 (18:41 +0200)]
tc class: Show class names from file

It is possible to use class names from file /etc/iproute2/cls_names
which tc will use when showing class info:

    # tc/tc -nm class show dev lo
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
class htb 1:1 root rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
class htb web#1:20 parent 1:1 leaf 20: prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
class htb 1:2 root rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
class htb 1:30 parent 1:1 leaf 30: prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
class htb voip#1:40 parent 1:2 leaf 40: prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
class htb 1:50 parent 1:2 leaf 50: prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
class htb 1:60 parent 1:2 leaf 60: prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b

or to specify via file path:

    # tc/tc -nm -cf /tmp/cls_names class show dev lo

Class names file contains simple "maj:min  name" structure:

1:20    web
1:40    voip

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip netns: Fix rtnl error while print netns list
Vadim Kochan [Sat, 7 Mar 2015 06:30:58 +0000 (08:30 +0200)]
ip netns: Fix rtnl error while print netns list

Observed on the Linux 3.18:

    # ip netns
    RTNETLINK answers: Operation not supported
    net0

CC: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Fixes: d182ee1307c7 ("ipnetns: allow to get and set netns ids")
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agolib utils: Use helpers to get AF bit/byte len
Vadim Kochan [Sat, 28 Feb 2015 00:50:24 +0000 (02:50 +0200)]
lib utils: Use helpers to get AF bit/byte len

Added funcs to get AF_XXX len in bit/bytes and replace
places where switch(AF_XXX) is used for this.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: better 32bit support
Eric Dumazet [Tue, 10 Mar 2015 16:56:47 +0000 (09:56 -0700)]
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>
9 years agoss: Allow to specify sport/dport without ':'
Vadim Kochan [Fri, 27 Feb 2015 21:54:36 +0000 (23:54 +0200)]
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>
9 years agoman ip-netns: Notice about loose device when do 'del'
Vadim Kochan [Sun, 15 Mar 2015 15:49:16 +0000 (17:49 +0200)]
man ip-netns: Notice about loose device when do 'del'

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman tc: Highlight minor & major, notice they are hex
Vadim Kochan [Sun, 8 Mar 2015 23:07:17 +0000 (01:07 +0200)]
man tc: Highlight minor & major, notice they are hex

Also added some trivial form of the ID as "major:minor",
just for visualisation of explained words.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman ip-link: Add short description about 'group'
Vadim Kochan [Sat, 7 Mar 2015 13:43:37 +0000 (15:43 +0200)]
man ip-link: Add short description about 'group'

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman ip-link: Add notice about local netns devices
Vadim Kochan [Wed, 25 Feb 2015 13:46:22 +0000 (15:46 +0200)]
man ip-link: Add notice about local netns devices

Added some clarification why 'ip link set netns' can not
change network namespace for some kind of devices.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agom_bpf: remove unrelevant help lines
Daniel Borkmann [Fri, 27 Feb 2015 16:52:36 +0000 (17:52 +0100)]
m_bpf: remove unrelevant help lines

Left-overs when copying this over from cls_bpf. ;) Lets remove them.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jiri Pirko <jiri@resnulli.us>
9 years agoiproute: ip-gue/ip-fou manpages
Ebben Aries [Fri, 27 Feb 2015 16:27:39 +0000 (09:27 -0700)]
iproute: ip-gue/ip-fou manpages

Add missing GUE/FOU manpages to Makefile

Signed-off-by: Ebben Aries <exa@fb.com>
9 years agobridge link: add support to specify master
Roopa Prabhu [Thu, 26 Feb 2015 08:12:59 +0000 (00:12 -0800)]
bridge link: add support to specify master

This patch adds support to specify 'master' keyword,
to target a bridge link command explicitly to the software
bridge driver.

Adds self/master keywords to usage and man page

v2:
fix usage to say (self and master) and not (self or master)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
9 years agoman ip-link: Add short info about 'dynamic' flag
Vadim Kochan [Thu, 26 Feb 2015 01:12:08 +0000 (03:12 +0200)]
man ip-link: Add short info about 'dynamic' flag

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: group DCTCP socket statistics
Hagen Paul Pfeifer [Tue, 24 Feb 2015 21:24:51 +0000 (22:24 +0100)]
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>
9 years agoFix misspelling of defrag in ip-l2tp.8
Lennart Sorensen [Tue, 24 Feb 2015 20:29:15 +0000 (15:29 -0500)]
Fix misspelling of defrag in ip-l2tp.8

9 years agoip-monitor: allow to monitor ip rules
Nicolas Dichtel [Tue, 24 Feb 2015 15:15:00 +0000 (16:15 +0100)]
ip-monitor: allow to monitor ip rules

Now done by default or with 'ip monitor rule'.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoss: Skip filtered netlink sockets before detailed info
Vadim Kochan [Sun, 22 Feb 2015 20:23:11 +0000 (22:23 +0200)]
ss: Skip filtered netlink sockets before detailed info

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Add filter before printing unix stats from Netlink
Vadim Kochan [Sun, 22 Feb 2015 20:23:10 +0000 (22:23 +0200)]
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>
9 years agoAllow specifying bridge port STP state by name rather than number.
Alex Pilon [Thu, 19 Feb 2015 19:27:46 +0000 (14:27 -0500)]
Allow specifying bridge port STP state by name rather than number.

The existing behaviour forces one to memorize the integer constants for
STP port states.

    # bridge link set dev dummy0 state 3

This patch makes it possible to use the lowercased port state name.

    # bridge link set dev dummy0 state forwarding

Invalid non-integer inputs now cause exit with status -1.

Signed-off-by: Alex Pilon <alp@alexpilon.ca>
9 years agobridge/fdb: display link netns id
Nicolas Dichtel [Tue, 17 Feb 2015 16:30:39 +0000 (17:30 +0100)]
bridge/fdb: display link netns id

When this attribute is set, it means that the i/o part of the related netdevice
is in another netns.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoiplink: add support of IFLA_LINK_NETNSID attribute
Nicolas Dichtel [Tue, 17 Feb 2015 16:30:38 +0000 (17:30 +0100)]
iplink: add support of IFLA_LINK_NETNSID attribute

This new attribute is now advertised by the kernel for x-netns interfaces.
It's also possible to set it when an interface is created (and thus creating a
x-netns interface with one single message).

Example:
 $ ip netns add foo
 $ ip netns add bar
 $ ip -n foo netns set bar 15
 $ ip -n foo link add ipip1 link-netnsid 15 type ipip remote 10.16.0.121 local 10.16.0.249
 $ ip -n foo link ls ipip1
 3: ipip1@NONE: <POINTOPOINT,NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default
     link/ipip 10.16.0.249 peer 10.16.0.121 link-netnsid 15

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoipnetns: allow to get and set netns ids
Nicolas Dichtel [Tue, 17 Feb 2015 16:30:37 +0000 (17:30 +0100)]
ipnetns: allow to get and set netns ids

The kernel now provides ids for peer netns. This patch implements a new command
'set' to assign an id.
When netns are listed, if an id is assigned, it is now displayed.

Example:
 $ ip netns add foo
 $ ip netns set foo 1
 $ ip netns
 foo (id: 1)
 init_net

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoip xfrm mon: Add objects list to the usage output
Vadim Kochan [Sat, 14 Feb 2015 18:07:44 +0000 (20:07 +0200)]
ip xfrm mon: Add objects list to the usage output

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip xfrm: Allow to specify "all" option for monitor
Vadim Kochan [Sat, 14 Feb 2015 17:45:04 +0000 (19:45 +0200)]
ip xfrm: Allow to specify "all" option for monitor

Just to be aligned with the usage output.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoprevent the read ahead of /proc/slabinfo in ss
Bryton Lee [Thu, 12 Feb 2015 06:16:04 +0000 (14:16 +0800)]
prevent the read ahead of /proc/slabinfo in ss

Signed-off-by: Bryton Lee <brytonlee01@gmail.com>
9 years agoss: Fixed wrong tcp ato value from netlink
Vadim Kochan [Fri, 13 Feb 2015 20:14:04 +0000 (22:14 +0200)]
ss: Fixed wrong tcp ato value from netlink

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Unify socket address output by one generic func
Vadim Kochan [Fri, 13 Feb 2015 20:14:03 +0000 (22:14 +0200)]
ss: Unify socket address output by one generic func

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Unify details info output:ino,uid,sk
Vadim Kochan [Fri, 13 Feb 2015 20:14:02 +0000 (22:14 +0200)]
ss: Unify details info output:ino,uid,sk

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Unify state socket output:netid, state, rq, wq
Vadim Kochan [Fri, 13 Feb 2015 20:14:01 +0000 (22:14 +0200)]
ss: Unify state socket output:netid, state, rq, wq

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Replace unixstat struct by new sockstat struct
Vadim Kochan [Fri, 13 Feb 2015 20:14:00 +0000 (22:14 +0200)]
ss: Replace unixstat struct by new sockstat struct

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Replace pktstat struct by new sockstat struct
Vadim Kochan [Fri, 13 Feb 2015 20:13:59 +0000 (22:13 +0200)]
ss: Replace pktstat struct by new sockstat struct

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Split tcpstap struct to sockstat & tcpstat
Vadim Kochan [Fri, 13 Feb 2015 20:13:58 +0000 (22:13 +0200)]
ss: Split tcpstap struct to sockstat & tcpstat

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Fix filter expression parser
Vadim Kochan [Fri, 13 Feb 2015 11:01:08 +0000 (13:01 +0200)]
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>
9 years agoupdate headers to 3.20-rc1
Stephen Hemminger [Sat, 21 Feb 2015 00:58:45 +0000 (16:58 -0800)]
update headers to 3.20-rc1

Add net_namespace.h and update other headers

9 years agoMerge branch 'net-next'
Stephen Hemminger [Tue, 10 Feb 2015 23:20:57 +0000 (15:20 -0800)]
Merge branch 'net-next'

9 years agov3.19.0
Stephen Hemminger [Tue, 10 Feb 2015 23:14:32 +0000 (15:14 -0800)]
v3.19.0

9 years agoss: Show stats from specified network namespace
Vadim Kochan [Sun, 8 Feb 2015 06:58:43 +0000 (08:58 +0200)]
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>
9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 5 Feb 2015 18:56:06 +0000 (10:56 -0800)]
Merge branch 'master' into net-next

9 years agoiproute: Descriptions of fou and gue options in ip-link man pages
Tom Herbert [Thu, 29 Jan 2015 16:52:01 +0000 (08:52 -0800)]
iproute: Descriptions of fou and gue options in ip-link man pages

Add section for additional arguments to GRE, IPIP, and SIT types
that are related to Foo-over-UDP and Generic UDP Encapsulation.
Also, added an example GUE configuration in the examples section.

Signed-off-by: Tom Herbert <therbert@google.com>
9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 5 Feb 2015 18:51:36 +0000 (10:51 -0800)]
Merge branch 'master' into net-next

9 years agoip link: Add support for remote checksum offload to IP tunnels
Tom Herbert [Thu, 29 Jan 2015 16:51:58 +0000 (08:51 -0800)]
ip link: Add support for remote checksum offload to IP tunnels

This patch adds support to remote checksum checksum offload
confinguration for IPIP, SIT, and GRE tunnels. This patch
adds a [no]encap-remcsum to ip link command which applicable
when configured tunnels that use GUE.

http://tools.ietf.org/html/draft-herbert-remotecsumoffload-00

Example:

ip link add name tun1 type gre remote 192.168.1.1 local 192.168.1.2 \
   ttl 225 encap fou encap-sport auto encap-dport 7777 encap-csum \
   encap-remcsum

This would create an GRE tunnel in GUE encapsulation where the source
port is automatically selected (based on hash of inner packet),
checksums in the encapsulating UDP header are enabled (needed.for
remote checksum offload), and remote checksum ffload is configured to
be used on the tunnel (affects TX side).

Signed-off-by: Tom Herbert <therbert@google.com>
9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 5 Feb 2015 18:48:19 +0000 (10:48 -0800)]
Merge branch 'master' into net-next

9 years agoiproute2: bridge vlan show new option to print ranges
Roopa Prabhu [Mon, 26 Jan 2015 02:26:25 +0000 (18:26 -0800)]
iproute2: bridge vlan show new option to print ranges

Introduce new option -c[ompressvlans] to request
vlan ranges from kernel

(pls suggest better option names if this does not look ok)

$bridge vlan show
port vlan ids
dummy0  1 PVID Egress Untagged

dummy1  1 PVID Egress Untagged
 2
 3
 4
 5
 6
 7
 9
 10
 12

br0  1 PVID Egress Untagged

$bridge help
Usage: bridge [ OPTIONS ] OBJECT { COMMAND | help }
where  OBJECT := { link | fdb | mdb | vlan | monitor }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] |
                    -o[neline] | -t[imestamp] | -n[etns] name |
                    -c[ompressvlans] }
$bridge -c vlan show
port vlan ids
dummy0  1 PVID Egress Untagged

dummy1  1 PVID Egress Untagged
 2-7
 9-10
 12

br0  1 PVID Egress Untagged

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
9 years agoiproute2: bridge: support vlan range adds
Roopa Prabhu [Mon, 26 Jan 2015 02:26:24 +0000 (18:26 -0800)]
iproute2: bridge: support vlan range adds

This patch adds vlan range support to bridge add command
using the newly added vinfo flags BRIDGE_VLAN_INFO_RANGE_BEGIN and
BRIDGE_VLAN_INFO_RANGE_END.

$bridge vlan show
port    vlan ids
br0      1 PVID Egress Untagged

dummy0   1 PVID Egress Untagged

$bridge vlan add vid 10-15 dev dummy0
port    vlan ids
br0      1 PVID Egress Untagged

dummy0   1 PVID Egress Untagged
         10
         11
         12
         13
         14
         15

$bridge vlan del vid 14 dev dummy0

$bridge vlan show
port    vlan ids
br0      1 PVID Egress Untagged

dummy0   1 PVID Egress Untagged
         10
         11
         12
         13
         15

$bridge vlan del vid 10-15 dev dummy0

$bridge vlan show
port    vlan ids
br0      1 PVID Egress Untagged

dummy0   1 PVID Egress Untagged

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
9 years agotc: add support for BPF based actions
Jiri Pirko [Mon, 19 Jan 2015 15:56:30 +0000 (16:56 +0100)]
tc: add support for BPF based actions

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agotc: push bpf common code into separate file
Jiri Pirko [Mon, 19 Jan 2015 15:56:29 +0000 (16:56 +0100)]
tc: push bpf common code into separate file

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agocan: Add support for CAN FD non-ISO feature
Oliver Hartkopp [Thu, 22 Jan 2015 18:04:33 +0000 (19:04 +0100)]
can: Add support for CAN FD non-ISO feature

This patch makes CAN_CTRLMODE_FD_NON_ISO netlink feature configurable.

During the CAN FD standardization process within the ISO it turned out that
the failure detection capability has to be improved.

The CAN in Automation organization (CiA) defined the already implemented CAN
FD controllers as 'non-ISO' and the upcoming improved CAN FD controllers as
'ISO' compliant. See at http://www.can-cia.com/index.php?id=1937

Starting with the - currently non-ISO - driver for M_CAN v3.0.1 introduced in
Linux 3.18 this bit needs to be propagated to userspace. In future drivers this
bit will become configurable depending on the CAN FD controllers capabilities.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 5 Feb 2015 18:33:13 +0000 (10:33 -0800)]
Merge branch 'master' into net-next

9 years agovxlan: Group policy extension
Thomas Graf [Thu, 15 Jan 2015 13:54:25 +0000 (14:54 +0100)]
vxlan: Group policy extension

Signed-off-by: Thomas Graf <tgraf@suug.ch>
9 years agoiproute2/ip: fix up filter when printing addresses
Andreas Henriksson [Fri, 23 Jan 2015 12:10:33 +0000 (13:10 +0100)]
iproute2/ip: fix up filter when printing addresses

"ip addr show up" would exclude the interface (link), but include the
addresses of down interfaces (which looked like they where indented
under a different interface). This fixes the filtering.

For a full example see the original bug report at:
http://bugs.debian.org/776040

Reported-by: Paul Slootman <paul@debian.org>
CC: 776040@bugs.debian.org
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
9 years agoip netns: Delete all netns
Vadim Kochan [Sun, 18 Jan 2015 14:10:19 +0000 (16:10 +0200)]
ip netns: Delete all netns

Allow delete all namespace names by:

    $ ip -all netns del

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip netns: Allow exec on each netns
Vadim Kochan [Sun, 18 Jan 2015 14:10:18 +0000 (16:10 +0200)]
ip netns: Allow exec on each netns

This change allows to exec some cmd on each
named netns (except default) by specifying '-all' option:

    # ip -all netns exec ip link

Each command executes synchronously.

Exit status is not considered, so there might be a case
that some CMD can fail on some netns but success on the other.

EXAMPLES:

1) Show link info on all netns:

$ ip -all netns exec ip link

netns: test_net
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
    link/ether 1a:19:6f:25:eb:85 brd ff:ff:ff:ff:ff:ff

netns: home0
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
    link/ether ea:1a:59:40:d3:29 brd ff:ff:ff:ff:ff:ff

netns: lan0
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500
    link/ether ce:49:d5:46:81:ea brd ff:ff:ff:ff:ff:ff

2) Set UP tap0 device for the all netns:

$ ip -all netns exec ip link set dev tap0 up

netns: test_net

netns: home0

netns: lan0

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agolib: Exec func on each netns
Vadim Kochan [Sun, 18 Jan 2015 14:10:17 +0000 (16:10 +0200)]
lib: Exec func on each netns

Added possibility to run some func on each netns.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoupdate kernel headers based on net-next 3.21
Stephen Hemminger [Thu, 5 Feb 2015 18:20:58 +0000 (10:20 -0800)]
update kernel headers based on net-next 3.21

Pull in headers from later tree

9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Thu, 5 Feb 2015 18:20:10 +0000 (10:20 -0800)]
Merge branch 'master' into net-next

9 years agocan: update kernel header
Stephen Hemminger [Thu, 5 Feb 2015 18:17:50 +0000 (10:17 -0800)]
can: update kernel header

Sanitized header from upstream 3.20-rc kernel

9 years agoss: Unify inet sockets output
Vadim Kochan [Tue, 20 Jan 2015 14:14:24 +0000 (16:14 +0200)]
ss: Unify inet sockets output

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Unify meminfo output
Vadim Kochan [Tue, 20 Jan 2015 14:14:23 +0000 (16:14 +0200)]
ss: Unify meminfo output

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotests: Add few 'ip link' related tests
Vadim Kochan [Thu, 15 Jan 2015 16:59:22 +0000 (18:59 +0200)]
tests: Add few 'ip link' related tests

Added two tests which checks the following fixed issues:

    1) Bug when not possible add new virtual interface via:

        $ ip link add dev XXX type

       It was fixed a few releases ago.

    2) Crash on older kernels when VF rate info does not exist:

        $ ip link show

       Used dump file from William Dauchy <william@gandi.net>:
           testsuite/tests/ip/link/dev_wo_vf_rate.nl

       So 'ip link show' replaced by 'ip -d monitor file ...' which does
       the same thing.

Also added new func in testsuite/lib/generic.sh to gen new random dev name.

Added 'clean' dependency on running all tests.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Filter inet dgram sockets with established state by default
Vadim Kochan [Thu, 8 Jan 2015 17:32:22 +0000 (19:32 +0200)]
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>
9 years agolib: fix setns() function when !HAVE_SETNS
Nicolas Dichtel [Thu, 15 Jan 2015 10:36:25 +0000 (11:36 +0100)]
lib: fix setns() function when !HAVE_SETNS

When HAVE_SETNS is not set, iproute2 provides a local implementation of this
function based on __NR_setns.
This macro is defined in sys/syscall.h, which was not included, thus the local
implementation always returned -1.

CC: Vadim Kochan <vadim4j@gmail.com>
Fixes: eb67e4498aec ("lib: Add netns_switch func for change network namespace")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agolib: fix warning in namespace.h
Nicolas Dichtel [Thu, 15 Jan 2015 10:36:24 +0000 (11:36 +0100)]
lib: fix warning in namespace.h

Warning was:
In file included from bridge.c:16:0:
../include/namespace.h:33:12: warning: ‘setns’ defined but not used [-Wunused-function]

CC: Vadim Kochan <vadim4j@gmail.com>
Fixes: eb67e4498aec ("lib: Add netns_switch func for change network namespace")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoiproute2: ip-link.8.in: Spelling fixes
Reese Moore [Wed, 4 Feb 2015 19:04:48 +0000 (14:04 -0500)]
iproute2: ip-link.8.in: Spelling fixes

In the ip-link(8) man page, for the gretap, ip6gre, and ip6gretap types, the
word tunnel was incorrectly spelled 'tuunel'.

Signed-off-by: Reese Moore <ram@vt.edu>
9 years agoneighbor: check return values
Stephen Hemminger [Wed, 14 Jan 2015 02:06:16 +0000 (18:06 -0800)]
neighbor: check return values

Need to check for invalid address and buffer overrun in ip neigh
command with invalid paramters.

9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Wed, 14 Jan 2015 01:43:45 +0000 (17:43 -0800)]
Merge branch 'master' into net-next

9 years agoip: route: add congestion control metric
Daniel Borkmann [Thu, 8 Jan 2015 23:13:06 +0000 (00:13 +0100)]
ip: route: add congestion control metric

This patch adds configuration and dumping of congestion control metric
for ip route, for example:

  ip route add <dst> dev foo congctl [lock] dctcp

Reference: http://thread.gmane.org/gmane.linux.network/344733
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
9 years agoupdate kernel headers to 3.19 net-next
Stephen Hemminger [Wed, 14 Jan 2015 01:39:32 +0000 (17:39 -0800)]
update kernel headers to 3.19 net-next

9 years agonetns: Rename & move get_netns_fd to lib
Vadim Kochan [Tue, 13 Jan 2015 20:08:44 +0000 (22:08 +0200)]
netns: Rename & move get_netns_fd to lib

Renamed get_netns_fd -> netns_get_fd and moved to
lib/namespace.c

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoUse one func to print timestamp from nlmsg
Vadim Kochan [Tue, 13 Jan 2015 18:14:24 +0000 (20:14 +0200)]
Use one func to print timestamp from nlmsg

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoAdd define for nlmsg_types with timestamp
Vadim Kochan [Tue, 13 Jan 2015 18:14:23 +0000 (20:14 +0200)]
Add define for nlmsg_types with timestamp

Add #define for nlmsg_type = 15

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Usage filter state names, options alignment
Vadim Kochan [Thu, 8 Jan 2015 02:30:43 +0000 (04:30 +0200)]
ss: Usage filter state names, options alignment

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Fix case when UDP is printed as ipproto-xxx
Vadim Kochan [Thu, 8 Jan 2015 00:42:54 +0000 (02:42 +0200)]
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>
9 years agoip link: Fix crash on older kernels when show VF dev
Vadim Kochan [Fri, 9 Jan 2015 19:24:31 +0000 (21:24 +0200)]
ip link: Fix crash on older kernels when show VF dev

The issue was caused that ifla_vf_rate does not exist on
older kernels and should be checked if it exists as nested attr.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Reported-by: William Dauchy <william@gandi.net>
Tested-by: William Dauchy <william@gandi.net>
9 years agoactions: Get vlan action to work in pipeline
Jamal Hadi Salim [Sun, 11 Jan 2015 14:31:30 +0000 (09:31 -0500)]
actions: Get vlan action to work in pipeline

When specified in a graph such as:
action vlan ... action foobar
the vlan action chewed more than it can swallow

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
9 years agoiplink: print out addrgenmode attribute
Jiri Pirko [Thu, 8 Jan 2015 08:49:55 +0000 (09:49 +0100)]
iplink: print out addrgenmode attribute

addrgenmode is currently write only by ip. So display this information
if provided by kernel as well.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoss: Filtering logic changing, with fixes
Vadim Kochan [Sun, 4 Jan 2015 20:18:40 +0000 (22:18 +0200)]
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>
9 years agoss: Unify packet stats output from netlink and proc
Vadim Kochan [Sun, 4 Jan 2015 20:18:39 +0000 (22:18 +0200)]
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>
9 years agoss: Unify unix stats output from netlink and proc
Vadim Kochan [Sun, 4 Jan 2015 20:18:38 +0000 (22:18 +0200)]
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>
9 years agolibnetlink: add parse_rtattr_one_nested helper
Jiri Pirko [Tue, 6 Jan 2015 16:23:45 +0000 (17:23 +0100)]
libnetlink: add parse_rtattr_one_nested helper

Sometimes, it is more convenient to get only one specific nested attribute by
type. For example for IFLA_AF_SPEC where type is address family (AF_INET6).
So add this helper for this purpose.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agofix spelling of Kuznetsov
Stephen Hemminger [Sat, 3 Jan 2015 17:58:41 +0000 (09:58 -0800)]
fix spelling of Kuznetsov

Suggested by Vadim Kochan