]> git.proxmox.com Git - mirror_iproute2.git/log
mirror_iproute2.git
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

9 years agobridge/link: add learning_sync policy flag
Scott Feldman [Mon, 29 Dec 2014 20:20:07 +0000 (12:20 -0800)]
bridge/link: add learning_sync policy flag

v2:

Resending now that the dust has cleared in 3.18 on "self" vs. hwmode debate for
brport settings.  learning_sync is now set/cleared using "self" qualifier on
brport.

v1:

Add 'learned_sync' flag to turn on/off syncing of learned MAC addresses from
offload device to bridge's FDB.   Flag is be set/cleared on offload device port
using "self" qualifier:

  $ sudo bridge link set dev swp1 learning_sync on self

  $ bridge -d link show dev swp1
  2: swp1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 2
      hairpin off guard off root_block off fastleave off learning off flood off
  2: swp1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0
      learning on learning_sync on

Adds new IFLA_BRPORT_LEARNED_SYNCED attribute for IFLA_PROTINFO on the SELF
brport.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
9 years agoman ss: Add state filter description
Vadim Kochan [Thu, 1 Jan 2015 18:01:06 +0000 (10:01 -0800)]
man ss: Add state filter description

Stolen from generated doc/ss.html
Also added reference to RFC 793 for TCP states.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman tc: Add description for -graph option
Vadim Kochan [Sun, 28 Dec 2014 10:33:05 +0000 (12:33 +0200)]
man tc: Add description for -graph option

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip: Small corrections of '-tshort' option in usage
Vadim Kochan [Sun, 28 Dec 2014 09:47:43 +0000 (11:47 +0200)]
ip: Small corrections of '-tshort' option in usage

Fixed -t[short] to -ts[hort] as '-t' is related to
-timestamp option.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotc: Allow to easy change network namespace
Vadim Kochan [Wed, 24 Dec 2014 21:04:11 +0000 (23:04 +0200)]
tc: Allow to easy change network namespace

Added new '-netns' option to simplify executing following cmd:

    ip netns exec NETNS tc OPTIONS COMMAND OBJECT

    to

    tc -n[etns] NETNS OPTIONS COMMAND OBJECT

e.g.:

    tc -net vnet0 qdisc

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agobridge: Allow to easy change network namespace
Vadim Kochan [Wed, 24 Dec 2014 21:04:10 +0000 (23:04 +0200)]
bridge: Allow to easy change network namespace

Added new '-netns' option to simplify executing following cmd:

    ip netns exec NETNS bridge OPTIONS COMMAND OBJECT

    to

    bridge -n[etns] NETNS OPTIONS COMMAND OBJECT

e.g.:

    bridge -net vnet0 fdb

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoip: Allow to easy change network namespace
Vadim Kochan [Wed, 24 Dec 2014 21:04:09 +0000 (23:04 +0200)]
ip: Allow to easy change network namespace

Added new '-netns' option to simplify executing following cmd:

    ip netns exec NETNS ip OPTIONS COMMAND OBJECT

    to

    ip -n[etns] NETNS OPTIONS COMMAND OBJECT

e.g.:

    ip -net vnet0 link add br0 type bridge
    ip -n vnet0 link

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agolib: Add netns_switch func for change network namespace
Vadim Kochan [Wed, 24 Dec 2014 21:04:08 +0000 (23:04 +0200)]
lib: Add netns_switch func for change network namespace

New netns_switch func moved to the lib/namespace.c from ip/ipnetns.c
so it can be used from the other tools for fast switching
network namespace.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoss: Use rtnl_dump_filter for inet_show_netlink
Vadim Kochan [Fri, 26 Dec 2014 02:26:27 +0000 (04:26 +0200)]
ss: Use rtnl_dump_filter for inet_show_netlink

Just another refactoring for ss to use rtnl API from lib

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman ip-link: Small example of 'ip link show master'
Vadim Kochan [Fri, 26 Dec 2014 02:46:20 +0000 (04:46 +0200)]
man ip-link: Small example of 'ip link show master'

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotc class: Show classes as ASCII graph
Vadim Kochan [Fri, 26 Dec 2014 00:10:06 +0000 (02:10 +0200)]
tc class: Show classes as ASCII graph

Added new '-g[raph]' option which shows classes in the graph view.

Meanwhile only generic stats info output is supported.

e.g.:

$ tc/tc -g class show dev tap0
+---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
|    +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
|    +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
|    |    +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
|    |
|    +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
|
+---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
     +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
     +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
     +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b

$ tc/tc -g -s class show dev tap0
+---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
|    |    Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
|    |    rate 0bit 0pps backlog 0b 0p requeues 0
|    |
|    +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
|    |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
|    |          rate 0bit 0pps backlog 0b 0p requeues 0
|    |
|    +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
|    |    |     Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
|    |    |     rate 0bit 0pps backlog 0b 0p requeues 0
|    |    |
|    |    +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
|    |               Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
|    |               rate 0bit 0pps backlog 0b 0p requeues 0
|    |
|    +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
|               Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
|               rate 0bit 0pps backlog 0b 0p requeues 0
|
+---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
     |    Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
     |    rate 0bit 0pps backlog 0b 0p requeues 0
     |
     +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
     |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
     |          rate 0bit 0pps backlog 0b 0p requeues 0
     |
     +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
     |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
     |          rate 0bit 0pps backlog 0b 0p requeues 0
     |
     +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
                Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
                rate 0bit 0pps backlog 0b 0p requeues 0

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip: extend "ip-address" man page to reflect the recent flag extensions
Heiner Kallweit [Wed, 24 Dec 2014 22:11:50 +0000 (23:11 +0100)]
ip: extend "ip-address" man page to reflect the recent flag extensions

Extend "ip-address" man page to reflect the recent extension of
allowing to list addresses with flags tentative, deprecated, dadfailed
not being set.

Signed-off-by: Heiner Kallweit <heiner.kallweit@web.de>
9 years agobridge link: add option 'self'
Roopa Prabhu [Sat, 6 Dec 2014 08:21:01 +0000 (00:21 -0800)]
bridge link: add option 'self'

Currently self is set internally only if hwmode is set.
This makes it necessary for the hw to have a mode.
There is no hwmode really required to go to hardware. So, introduce
self for anybody who wants to target hardware.

v1 -> v2
    - fix a few bugs. Initialize flags to zero: this was required to
    keep the current behaviour unchanged.

v2 -> v3
    - fix comment

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
9 years agoip link: use addattr_nest()/addattr_nest_end()
Duan Jiong [Wed, 17 Dec 2014 07:28:45 +0000 (15:28 +0800)]
ip link: use addattr_nest()/addattr_nest_end()

Use addattr_nest() and addattr_nest_end() to simplify the code.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
9 years agoMerge branch 'net-next'
Stephen Hemminger [Wed, 24 Dec 2014 20:23:00 +0000 (12:23 -0800)]
Merge branch 'net-next'

9 years agov3.18.0
Stephen Hemminger [Wed, 24 Dec 2014 20:20:49 +0000 (12:20 -0800)]
v3.18.0

9 years agoip link: Show devices by type
Vadim Kochan [Wed, 10 Dec 2014 08:11:29 +0000 (10:11 +0200)]
ip link: Show devices by type

Added new option 'type' to 'ip link show'
command which allows to filter devices by type:

    ip link show type bridge
    ip link show type vlan

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip: allow ip address show to list addresses with certain flags not being set
Heiner Kallweit [Mon, 22 Dec 2014 19:18:43 +0000 (20:18 +0100)]
ip: allow ip address show to list addresses with certain flags not being set

Sometimes it's needed to have "ip address show" list only addresses
with certain flags not being set, e.g. in network scripts.
As an example one might want to exclude addresses in "tentative"
or "deprecated" state.

Support listing addresses with flags tentative, deprecated, dadfailed
not being set by prefixing the respective flag with a minus.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
9 years agoip lib: Added shorter timestamp option
Vadim Kochan [Mon, 22 Dec 2014 22:13:58 +0000 (00:13 +0200)]
ip lib: Added shorter timestamp option

Added another timestamp format to look like more logging info:

[2014-12-22T22:36:50.489 ] 2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
    link/ether 3c:97:0e:a3:86:2e brd ff:ff:ff:ff:ff:ff

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agowhitespace cleanup
Stephen Hemminger [Sat, 20 Dec 2014 23:47:17 +0000 (15:47 -0800)]
whitespace cleanup

Remove all trailing whitespace and space before tabs.

9 years agoss: Dont show netlink and packet sockets by default
Vadim Kochan [Sat, 20 Dec 2014 23:40:55 +0000 (15:40 -0800)]
ss: Dont show netlink and packet sockets by default

Checking by SS_CLOSE state was remowed in:

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

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

Here is most correct fix which considers specified family.

To see netlink sockets:
    ss -A netlink

To see packet sockets:
    ss -A packet

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

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoupdate kernel headers to 3.19-rc1
Stephen Hemminger [Sat, 20 Dec 2014 20:22:01 +0000 (12:22 -0800)]
update kernel headers to 3.19-rc1

9 years agoMerge branch 'master' into net-next
Stephen Hemminger [Sat, 20 Dec 2014 20:18:14 +0000 (12:18 -0800)]
Merge branch 'master' into net-next

9 years agoss: Use rtnl_dump_filter in handle_netlink_request
vadimk [Thu, 4 Dec 2014 10:32:58 +0000 (12:32 +0200)]
ss: Use rtnl_dump_filter in handle_netlink_request

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

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

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoresolve header file conflict betwen linux/in6.h and netinet/in.h
Stephen Hemminger [Sat, 20 Dec 2014 20:12:34 +0000 (12:12 -0800)]
resolve header file conflict betwen linux/in6.h and netinet/in.h

Go back to kernel version of if_bridge.h and use patched
version of linux/in6.h and libc-compat.h

9 years agort_names can't be const
Stephen Hemminger [Sat, 20 Dec 2014 19:36:54 +0000 (11:36 -0800)]
rt_names can't be const

Needs to be built at runtime.

9 years agoss: Use nl_proto_a2n for filtering by netlink proto
vadimk [Sat, 6 Dec 2014 00:52:19 +0000 (02:52 +0200)]
ss: Use nl_proto_a2n for filtering by netlink proto

Now it is posible to filter by existing Netlink protos:

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

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agolib names: Add helper func for parse id and name from file
vadimk [Sat, 6 Dec 2014 02:05:12 +0000 (04:05 +0200)]
lib names: Add helper func for parse id and name from file

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agolib names: Use CONFDIR for specify 'group' file path
vadimk [Sat, 6 Dec 2014 02:05:11 +0000 (04:05 +0200)]
lib names: Use CONFDIR for specify 'group' file path

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoiproute2: Add support for CAN presume-ack feature
Nikita Edward Baruzdin [Fri, 5 Dec 2014 08:41:42 +0000 (11:41 +0300)]
iproute2: Add support for CAN presume-ack feature

This patch makes CAN_CTRLMODE_PRESUME_ACK netlink feature configurable.
When enabled, the feature sets CAN controller in mode in which
acknowledgement absence is ignored.

Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@gmail.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
9 years agoiproute2/nstat: Bug in displaying icmp stats
Eric Dumazet [Sat, 6 Dec 2014 02:10:08 +0000 (18:10 -0800)]
iproute2/nstat: Bug in displaying icmp stats

On Fri, 2014-12-05 at 17:13 -0800, Eric Dumazet wrote:

> I guess we could count number of spaces/fields in both lines,
> and disable the iproute2 trick if counts match.

Something like that maybe ?

 misc/nstat.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
Tested-by: Vijay Subramanian <subramanian.vijay@gmail.com>