]> git.proxmox.com Git - mirror_iproute2.git/log
mirror_iproute2.git
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>
9 years agoss: Fix layout/output issues introduced by regression
vadimk [Fri, 5 Dec 2014 17:19:11 +0000 (19:19 +0200)]
ss: Fix layout/output issues introduced by regression

This patch fixes the following issues which was introduced by me in commits:

    #1 (2dc854854b7f1b) ss: Fixed broken output for Netlink 'Peer Address:Port' column
    ISSUE: Broken layout when all sockets are printed out

    #2 (eef43b5052afb7) ss: Identify more netlink protocol names
    ISSUE: Protocol id is not printed if 'numbers only' output was specified (-n)

Also aligned the width of the local/peer ports to be more wider.

I tested with a lot of option combinations (I may miss some test cases),
but layout seems to me better than the previous released version of iproute2/ss.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoif_bridge: remove in6.h
Stephen Hemminger [Wed, 10 Dec 2014 04:19:26 +0000 (20:19 -0800)]
if_bridge: remove in6.h

Adding in6.h breaks build with redefined values.

9 years agoip monitor: Fix issue when timestamp is printed w/o msg
vadimk [Fri, 5 Dec 2014 00:18:59 +0000 (02:18 +0200)]
ip monitor: Fix issue when timestamp is printed w/o msg

The issue was observed when IPv6 router broadcasted NDUSEROPT
messages which are not handled by monitor and caused printing
'Timestamps' w/o message because such kind of rtnl messages is not
handled by monitor.

As 'ip monitor' by default subscribes to the all mcast rtnl groups except
RTGRP_TC then all messages of these rtnl groups which are not handled by
monitor may cause such issues.

Fixed by subscribing by default to rtnl mcast groups which are
supported by 'ip monitor'.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoipaddress: enable -details option
Nicolas Dichtel [Thu, 4 Dec 2014 16:41:07 +0000 (17:41 +0100)]
ipaddress: enable -details option

This option was used only for 'ip link', but it can be useful to have it for
'ip address'. Thus it is possible to display link details and addresses with one
command.

Example:
$ ip -d a ls dev gre1
9: gre1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1468 qdisc noqueue state UNKNOWN group default
    link/gre 10.16.0.249 peer 10.16.0.121 promiscuity 0
    gre remote 10.16.0.121 local 10.16.0.249 ttl inherit ikey 0.0.0.10 okey 0.0.0.10 icsum ocsum
    inet 192.168.0.249 peer 192.168.0.121/32 scope global gre1
       valid_lft forever preferred_lft forever
    inet6 fe80::5efe:a10:f9/64 scope link
       valid_lft forever preferred_lft forever

Suggested-by: Christophe Gouault <christophe.gouault@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agobridge/fdb: fix statistics output spacing
Scott Feldman [Thu, 4 Dec 2014 08:57:14 +0000 (09:57 +0100)]
bridge/fdb: fix statistics output spacing

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoneed libc-compat.h for new in6.h
Stephen Hemminger [Fri, 5 Dec 2014 20:47:34 +0000 (12:47 -0800)]
need libc-compat.h for new in6.h

The header wars continue...

9 years agoadd local version of linux/in6.h
Stephen Hemminger [Fri, 5 Dec 2014 20:16:36 +0000 (12:16 -0800)]
add local version of linux/in6.h

Need this header file to avoid build issues on older systems
like Debian 7

9 years agoip-link: fix unterminated string in manpage
Stephen Hemminger [Thu, 4 Dec 2014 03:35:36 +0000 (19:35 -0800)]
ip-link: fix unterminated string in manpage

Missing "

9 years agotc: minor spelling fixes
Stephen Hemminger [Thu, 4 Dec 2014 03:28:34 +0000 (19:28 -0800)]
tc: minor spelling fixes

9 years agotunnel: decode ESP tunnel type
Stephen Hemminger [Thu, 4 Dec 2014 03:08:41 +0000 (19:08 -0800)]
tunnel: decode ESP tunnel type

Add ESP to decode switch.

9 years agort_dsfield: fix Expedited Forwarding PHB
Stephen Hemminger [Thu, 4 Dec 2014 02:50:59 +0000 (18:50 -0800)]
rt_dsfield: fix Expedited Forwarding PHB

RFC 2598 defines Expedited Forwarding in section 2.3
   Codepoint 101110 is recommended for the EF PHB.
which translates to B8 as encoded in rt_dsfield

9 years agoman ip-link: Fix indentation for 'ip link show' options
vadimk [Tue, 2 Dec 2014 20:39:11 +0000 (22:39 +0200)]
man ip-link: Fix indentation for 'ip link show' options

BEFORE:
              The show command has additional formatting options:

       -s, -stats, -statistics
              output more statistics about packet usage.

       -d, -details
              output more detailed information.

       -h, -human, -human-readble
              output statistics with human readable values number followed by suffix

       -iec   print human readable rates in IEC units (ie. 1K = 1024).
AFTER:
       The show command has additional formatting options:

              -s, -stats, -statistics
                     output more statistics about packet usage.

              -d, -details
                     output more detailed information.

              -h, -human, -human-readble
                     output statistics with human readable values number followed by suffix

              -iec   print human readable rates in IEC units (ie. 1K = 1024).

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip route: don't assume default route
Pavel Simerda [Tue, 2 Dec 2014 16:45:10 +0000 (17:45 +0100)]
ip route: don't assume default route

Just print the help when "ip route del" is called without any other
arguments.

Resolves:

 * https://bugzilla.redhat.com/show_bug.cgi?id=997965

Signed-off-by: Pavel Šimerda <psimerda@redhat.com>
9 years agoconfigure: Add check for the doc tools
vadimk [Sun, 30 Nov 2014 16:08:25 +0000 (18:08 +0200)]
configure: Add check for the doc tools

Added checking existence of the doc files converters.
If the XXX tool exists then HAVE_XXX:=y will be written
to the Config file. Example of the configure script output:

TC schedulers
 ATM no
 IPT using xtables
 IPSET  yes

iptables modules directory: /usr/lib/iptables
libc has setns: yes
SELinux support: no

Docs
 latex: no
 WARNING: no docs can be built from LaTeX files
 sgml2html: yes

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoupdate if_bridge
Stephen Hemminger [Sun, 30 Nov 2014 17:48:14 +0000 (09:48 -0800)]
update if_bridge

Use current upstream header.

9 years agoss: Use generic handle_netlink_request for packet
vadimk [Sat, 29 Nov 2014 21:44:32 +0000 (23:44 +0200)]
ss: Use generic handle_netlink_request for packet

Get rid of self-handling and creating of Netlink socket for show packet
socket stats.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman ip-link: Add description for 'help' command
vadimk [Sat, 29 Nov 2014 19:49:21 +0000 (21:49 +0200)]
man ip-link: Add description for 'help' command

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Refactor to use macro for define diag nl request
vadimk [Thu, 30 Oct 2014 16:49:25 +0000 (18:49 +0200)]
ss: Refactor to use macro for define diag nl request

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip link: Allow to filter devices by master dev
Vadim Kochan [Sat, 29 Nov 2014 19:27:41 +0000 (11:27 -0800)]
ip link: Allow to filter devices by master dev

Added 'master' option to 'ip link show' command
to filter devices by master dev.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoiproute2: Add support for babel protocol table entry
Dave Taht [Tue, 4 Nov 2014 22:23:47 +0000 (14:23 -0800)]
iproute2: Add support for babel protocol table entry

9 years agoss: Fixed broken output for Netlink 'Peer Address:Port' column
vadimk [Sat, 18 Oct 2014 17:46:29 +0000 (20:46 +0300)]
ss: Fixed broken output for Netlink 'Peer Address:Port' column

When output the netlink sockets:

    ss -A netlink state close

the layout is a little broken with a shifted 'Peer Address:Port'
stars and empty new lines. Fixed by making the port field to be
wider for 'Local Address:Port' column.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Remove checking SS_CLOSE state for packet and netlink
vadimk [Thu, 16 Oct 2014 08:19:29 +0000 (11:19 +0300)]
ss: Remove checking SS_CLOSE state for packet and netlink

I dont see a reason that packet and netlink states will be
printed only if SS_CLOSE state is set in filter, in that case
to print states of netlink or packet sockets it is needed to run:

    ss -A netlink state close

instead of:

    ss -A netlink

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip netns: Identify netns for the current process
vadimk [Fri, 7 Nov 2014 16:25:30 +0000 (18:25 +0200)]
ip netns: Identify netns for the current process

As 'ip' util will share the same netns from the caller
process then we can just look at /proc/self/.. to show
the netns of the current process by:

    ip netns id

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotests: Move tc related tests to testsuite/tests/tc folder
vadimk [Fri, 31 Oct 2014 08:03:44 +0000 (10:03 +0200)]
tests: Move tc related tests to testsuite/tests/tc folder

With this change the results of tc tests will be recorded under:

    testsuite/results/tc/

The ip related tests can be added under:

    testsuite/tests/ip

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip monitor: Allow to filter events by dev
vadimk [Mon, 20 Oct 2014 09:25:17 +0000 (12:25 +0300)]
ip monitor: Allow to filter events by dev

Added 'dev' option to allow filtering events by device.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoss: Identify more netlink protocol names
vadimk [Thu, 30 Oct 2014 15:33:36 +0000 (17:33 +0200)]
ss: Identify more netlink protocol names

There were only few Netlink protocol names
which were printed on the screen:

    rtnl, fw, tcpdiag

So added the ability to identify Netlink proto name
from /etc/iproute/nl_protos or from static table.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agovxlan: Add support for enabling UDP checksums
Tom Herbert [Fri, 7 Nov 2014 16:05:34 +0000 (08:05 -0800)]
vxlan: Add support for enabling UDP checksums

Add udpcsum option to enable transmitting UDP checksums when doing
VXLAN/IPv4. Add udp6zerocsumtx, and udp6zerocsumrx options to enable
sending zero checksums and receiving zero checksums in VXLAN/IPv6.

Signed-off-by: Tom Herbert <therbert@google.com>
9 years agoip-link: Document IPoIB link type in the man page
Or Gerlitz [Sun, 16 Nov 2014 07:43:34 +0000 (09:43 +0200)]
ip-link: Document IPoIB link type in the man page

Add documentation on how to create devices of type IP-over-Infiniband
in the man page.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
9 years agoutils: relax strtoX checking in get_time_rtt
Florian Westphal [Tue, 11 Nov 2014 00:38:21 +0000 (01:38 +0100)]
utils: relax strtoX checking in get_time_rtt

ip route change dev tap0 192.168.7.0/24 rto_min 1ms
Error: argument "1ms" is wrong: "rto_min" value is invalid

get_time_rtt() checks for 's' or 'msec' and converts to milliseconds
if needed.

Fixes: 697ac63905 (utils: fix range checking for get_u32/get_u64 et all)
Signed-off-by: Florian Westphal <fw@strlen.de>
9 years agoiproute2: Man pages for fou and gue
Tom Herbert [Wed, 5 Nov 2014 18:06:28 +0000 (10:06 -0800)]
iproute2: Man pages for fou and gue

Man pages for Foo-over-UDP and Generic UDP Encapsulation receive
port configuration. gue man page links to fou one.

Signed-off-by: Tom Herbert <therbert@google.com>
9 years agoip link gre: Add support to configure FOU and GUE
Tom Herbert [Wed, 5 Nov 2014 18:06:26 +0000 (10:06 -0800)]
ip link gre: Add support to configure FOU and GUE

This patch adds support to configure foo-over-udp (FOU) and Generic
UDP Encapsulation for GRE tunnels. This configuration allows selection
of FOU or GUE for the tunnel, specification of the source and
destination ports for UDP tunnel, and enabling TX checksum. This
configuration only affects the transmit side of a tunnel.

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

This would create an GRE tunnel in GUE encapsulation where the source
port is automatically selected (based on hash of inner packet) and
checksums in the encapsulating UDP header are enabled.

Signed-off-by: Tom Herbert <therbert@google.com>
9 years agoip link ipip: Add support to configure FOU and GUE
Tom Herbert [Wed, 5 Nov 2014 18:06:25 +0000 (10:06 -0800)]
ip link ipip: Add support to configure FOU and GUE

This patch adds support to configure foo-over-udp (FOU) and Generic
UDP Encapsulation for IPIP and sit tunnels. This configuration allows
selection of FOU or GUE for the tunnel, specification of the source and
destination ports for UDP tunnel, and enabling TX checksum. This
configuration only affects the transmit side of a tunnel.

Example:

ip link add name tun1 type ipip remote 192.168.1.1 local 192.168.1.2 \
   ttl 225 encap gue encap-sport auto encap-dport 9999 encap-csum

This would create an IPIP tunnel in GUE encapsulation where the source
port is automatically selected (based on hash of inner packet) and
checksums in the encapsulating UDP header are enabled.

Signed-off-by: Tom Herbert <therbert@google.com>
9 years agoip fou: Support to configure foo-over-udp RX
Tom Herbert [Wed, 5 Nov 2014 18:06:24 +0000 (10:06 -0800)]
ip fou: Support to configure foo-over-udp RX

Added 'ip fou...' commands to enable/disable UDP ports for doing
foo-over-udp and Generic UDP Encapsulation variant. Arguments are port
number to bind to and IP protocol to map to port (for direct FOU).

Examples:

ip fou add port 7777 gue
ip fou add port 8888 ipproto 4

The first command creates a GUE port, the second creates a direct FOU
port for IPIP (receive payload is a assumed to be an IPv4 packet).

Signed-off-by: Tom Herbert <therbert@google.com>
9 years agoman: ip-link: fix a typo
Masatake YAMATO [Thu, 6 Nov 2014 18:57:05 +0000 (03:57 +0900)]
man: ip-link: fix a typo

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
9 years agoip-link: in human readable output use dynamic precision length
Christian Hesse [Tue, 4 Nov 2014 21:17:15 +0000 (22:17 +0100)]
ip-link: in human readable output use dynamic precision length

9 years agodoc ip-cref: Added missing ip options
vadimk [Tue, 4 Nov 2014 16:54:30 +0000 (18:54 +0200)]
doc ip-cref: Added missing ip options

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip-link: fix column alignment
Christian Hesse [Mon, 3 Nov 2014 07:21:11 +0000 (08:21 +0100)]
ip-link: fix column alignment

Width is the maximum number of characters used for the value, excluding a
field separator. So append a single whitespace.

9 years agoip: add iec formatted option and cleanup code
Stephen Hemminger [Sun, 2 Nov 2014 20:49:19 +0000 (12:49 -0800)]
ip: add iec formatted option and cleanup code

Add a new -iec option in addition to -human.
Cleanup code so the formatting of numbers is done in one function,
not 2 ways and 2 sizes.

9 years agoip-link: add switch to show human readable output
Christian Hesse [Fri, 31 Oct 2014 21:33:13 +0000 (22:33 +0100)]
ip-link: add switch to show human readable output

Byte and packet count can increase to really big numbers. This adds a
switch to show human readable output.

4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:de:ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    1523846973 3969051  0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    8710088361 6077735  0       0       0       0
4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:de:ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    1.5G       3.9M     0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    8.7G       6.0M     0       0       0       0

9 years agoiproute2: ip6_tunnel mode bugfixes: any,vti6
Alexey Andriyanov [Wed, 29 Oct 2014 06:19:30 +0000 (09:19 +0300)]
iproute2: ip6_tunnel mode bugfixes: any,vti6

- any ipv6 tunnel mode (proto == 0) could not be set
due to incomplete set of cases in do_add, do_del.
- vti6 logic was inverted: it was using "ip6_vti0" basedev
UNLESS mode is set to vti6.

We don't need a switch by p.proto in do_add()/do_del(): it
already exists in parse_args(). So if parse_args() call
was successful, no need to check tunnel mode again.

Signed-off-by: Alexey Andriyanov <alan@al-an.info>
9 years agoman: update doc after support of ESN and anti-replay window
Nicolas Dichtel [Thu, 30 Oct 2014 08:18:48 +0000 (01:18 -0700)]
man: update doc after support of ESN and anti-replay window

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoMerge branch 'net-next'
Stephen Hemminger [Thu, 30 Oct 2014 16:38:56 +0000 (09:38 -0700)]
Merge branch 'net-next'

Conflicts:
include/linux/if_tunnel.h

9 years agoxfrm: add support of ESN and anti-replay window
dingzhi [Mon, 20 Oct 2014 09:23:04 +0000 (11:23 +0200)]
xfrm: add support of ESN and anti-replay window

This patch allows to configure ESN and anti-replay window.

Signed-off-by: dingzhi <zhi.ding@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agonetlink: extend buffers to 16K
Eric Dumazet [Sat, 11 Oct 2014 16:43:13 +0000 (09:43 -0700)]
netlink: extend buffers to 16K

Starting from linux-3.15 (commit 9063e21fb026, "netlink: autosize skb
lengths"), kernel is able to send up to 16K in netlink replies.

This change enables iproute2 commands to get bigger chunks,
without breaking compatibility with old kernels.

Signed-off-by: Eric Dumazet <edumazet@google.com>
9 years agoss: output dctcp diag information
Daniel Borkmann [Mon, 29 Sep 2014 08:47:32 +0000 (10:47 +0200)]
ss: output dctcp diag information

Dump useful DCTCP state/debug information gathered from diag.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
9 years agoUpdate kernel headers to 3.18-rc2
Stephen Hemminger [Thu, 30 Oct 2014 05:32:02 +0000 (22:32 -0700)]
Update kernel headers to 3.18-rc2

9 years agotests: Allow to run tests recursively
vadimk [Fri, 10 Oct 2014 06:27:19 +0000 (09:27 +0300)]
tests: Allow to run tests recursively

Such approach allows to run *.t scripts from any
tests/ subdirectories.

One point is that tests from tests/cls/*.t (which are needed
by tests/cls-testbed.t but does not exist yet) will also
be ran aside with tests/cls-testbed.t which is not good
because in such case they will be ran twice, so renamed these
tests path to tests/cls/*.c in tests/cls-testbed.t

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotests: Skip cls-testbed.t if tests/cls dir does not exist
vadimk [Thu, 9 Oct 2014 15:51:24 +0000 (18:51 +0300)]
tests: Skip cls-testbed.t if tests/cls dir does not exist

Curently tests/cls-testbed.t tries to run any *.t in
tests/cls/ folder but such folder does not exist.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman ip: Add missing '-details' option
vadimk [Mon, 27 Oct 2014 15:22:58 +0000 (17:22 +0200)]
man ip: Add missing '-details' option

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agogitignore: Ignore 'doc' files generated at runtime
vadimk [Sun, 26 Oct 2014 10:18:56 +0000 (12:18 +0200)]
gitignore: Ignore 'doc' files generated at runtime

The list is based on doc/Makefile 'clean' target

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agodoc make: Add *.pdf files to the 'clean' target
vadimk [Sun, 26 Oct 2014 09:52:03 +0000 (11:52 +0200)]
doc make: Add *.pdf files to the 'clean' target

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoman ip-link: Fixed missing 'up' option in 'ip link show' synopsis
vadimk [Tue, 14 Oct 2014 15:01:34 +0000 (18:01 +0300)]
man ip-link: Fixed missing 'up' option in 'ip link show' synopsis

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agov3.17.0
Stephen Hemminger [Thu, 9 Oct 2014 15:40:14 +0000 (08:40 -0700)]
v3.17.0

9 years agoemp: fix warning on deprecated bison directive
Stephen Hemminger [Thu, 9 Oct 2014 15:31:10 +0000 (08:31 -0700)]
emp: fix warning on deprecated bison directive

emp_ematch.y:12.1-13: warning: deprecated directive, use ‘%name-prefix’ [-Wdeprecated]
 %name-prefix="ematch_"
 ^^^^^^^^^^^^^

9 years agoip link: Shortify printing the usage of link type
vadimk [Tue, 30 Sep 2014 05:17:31 +0000 (08:17 +0300)]
ip link: Shortify printing the usage of link type

Allow to print particular link type usage by:

    ip link help [TYPE]

Currently to print usage for some link type it is needed
to use the following way:

    ip link { add | del | set } type TYPE help

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotests: Check existing of /proc/config.gz before use it
vadimk [Tue, 30 Sep 2014 06:15:10 +0000 (09:15 +0300)]
tests: Check existing of /proc/config.gz before use it

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agodiscourage use of direct policer interface
Jamal Hadi Salim [Mon, 6 Oct 2014 11:41:21 +0000 (07:41 -0400)]
discourage use of direct policer interface

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
9 years agoroute classifier support for multiple actions
Jamal Hadi Salim [Mon, 6 Oct 2014 11:30:17 +0000 (07:30 -0400)]
route classifier support for multiple actions

route can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
9 years agotcindex classifier support for multiple actions
Jamal Hadi Salim [Mon, 6 Oct 2014 11:30:16 +0000 (07:30 -0400)]
tcindex classifier support for multiple actions

tcindex can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
9 years agoip tunnel: fix 'ip -oneline tunnel show' for some GRE tunnels
Dmitry Popov [Sat, 4 Oct 2014 15:00:25 +0000 (19:00 +0400)]
ip tunnel: fix 'ip -oneline tunnel show' for some GRE tunnels

'ip -oneline tunnel show' was not "oneline" for GRE tunnels with iseq:
# ip tun add gre_test remote 1.1.1.1 local 2.2.2.2 mode gre iseq oseq
# ip -oneline tun show gre_test | wc -l
2

The problem existed because of a typo: '\n' was printed when it shouldn't be.
Fixed.

Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
9 years agoip address: print stats with -s
Jiri Benc [Fri, 3 Oct 2014 13:25:02 +0000 (15:25 +0200)]
ip address: print stats with -s

Make ip address show accept the -s option similarly to ip link. This creates
an one command replacement for "ifconfig -a" useful for people who still
stay with ifconfig because of this feature.

Print the stats as the last thing for the interface. This requires some code
shuffling.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
9 years agoss: add more tcp socket diagnostics
Eric Dumazet [Wed, 1 Oct 2014 11:17:18 +0000 (04:17 -0700)]
ss: add more tcp socket diagnostics

Display 4 additional tcp socket info fields :

backoff : exponential backoff
lastsnd : time in milli second since last send
lastrcv : time in milli second since last receive
lastack : time in milli second since last acknowledgement

$ ss -ti dst :22
State       Recv-Q Send-Q                  Local Address:Port
Peer Address:Port
ESTAB       0      0                        172.16.5.1:58470
172.17.131.143:ssh
 cubic wscale:7,7 rto:228 rtt:30/20 ato:40 mss:1256 cwnd:6 ssthresh:4
send 2.0Mbps lastsnd:3480 lastrcv:3464 lastack:3464 rcv_rtt:81.5
rcv_space:87812

Signed-off-by: Eric Dumazet <edumazet@google.com>
9 years agoiplink: do not require assigning negative ifindex at link creation
Atzm Watanabe [Wed, 1 Oct 2014 05:47:50 +0000 (14:47 +0900)]
iplink: do not require assigning negative ifindex at link creation

Since commit 3c682146aeff, iplink requires assigning negative
ifindex (-1) to the kernel when creating interface without
specifying index.

v2: checking whether index is -1, suggested by Cong Wang.

Cc: Cong Wang <cwang@twopensource.com>
Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp>
Acked-by: Cong Wang <cwang@twopensource.com>
9 years agotests: Allow policer test to be ran
vadimk [Mon, 29 Sep 2014 22:22:22 +0000 (01:22 +0300)]
tests: Allow policer test to be ran

Renamed testsuite/tests/policer to testsuite/tests/policer.t

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotests: Add runtime generated files to .gitignore
vadimk [Mon, 29 Sep 2014 20:35:38 +0000 (23:35 +0300)]
tests: Add runtime generated files to .gitignore

When make tests then 2 folders are generated:

    testsuite/results
    testsuite/iproute2/iproute2-this

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip monitor: Changed 'Unknown message' format to be more informative
vadimk [Mon, 29 Sep 2014 20:07:57 +0000 (23:07 +0300)]
ip monitor: Changed 'Unknown message' format to be more informative

In case if unknown message was handled then it will be displayed as:

    Unknown message: type=0x00000044(68) flags=0x00000000(0) len=0x0000004c(76)

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoadd missing underscore to man page and example nf_mark ematch
Andy Furniss [Mon, 29 Sep 2014 19:43:01 +0000 (20:43 +0100)]
add missing underscore to man page and example nf_mark ematch

The man page and the "fail" example are missing an underscore in the
nf_mark ematch.

eg.

tc filter add dev eth0 parent ffff:  basic match 'meta(nfmark gt 24)'
classid 2:4

meta: unknown meta id

... >>meta(nfmark gt 24)<< ...
... meta(>>nfmark<< gt 24)...
Usage: meta(OBJECT { eq | lt | gt } OBJECT)
where: OBJECT  := { META_ID | VALUE }
        META_ID := id [ shift SHIFT ] [ mask MASK ]

Example: meta(nfmark gt 24)
          meta(indev shift 1 eq "ppp")
          meta(tcindex mask 0xf0 eq 0xf0)

For a list of meta identifiers, use meta(list).
Illegal "ematch"

meta(list) does correctly show nf_mark and the above test works with
nf_mark.

Signed-off-by: Andy Furniss adf.lists@gmail.com
9 years agoip netns: Create /var/run/netns dir when do 'ip netns monitor'
vadimk [Sun, 31 Aug 2014 19:45:29 +0000 (22:45 +0300)]
ip netns: Create /var/run/netns dir when do 'ip netns monitor'

netns monitor fails when there is no /var/run/netns dir
which might be created later while monitoring.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agotests: Fix problem with test running
vadimk [Sat, 6 Sep 2014 10:27:07 +0000 (13:27 +0300)]
tests: Fix problem with test running

Tests were not allowed to be ran, the following
issues were fixed:
    - creating the results folder before test running
    - sudo $PREFIX moved before variables definition which
        allow to pass them through the sudo to test script.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agorsvp classifier support for multiple actions
Jamal Hadi Salim [Sun, 28 Sep 2014 16:49:53 +0000 (12:49 -0400)]
rsvp classifier support for multiple actions

Example setup:

sudo tc qdisc del dev eth0 root handle 1:0 prio
sudo tc qdisc add dev eth0 root handle 1:0 prio

sudo tc filter add dev eth0 pref 10 proto ip parent 1:0 \
rsvp session 10.0.0.1 ipproto icmp \
classid 1:1  \
action police rate 1kbit burst 90k pipe \
action ok

tc -s filter show dev eth0 parent 1:0

filter protocol ip pref 10 rsvp
filter protocol ip pref 10 rsvp fh 0x0001100a flowid 1:1 session
10.0.0.1 ipproto icmp
        action order 1:  police 0x5 rate 1Kbit burst 23440b mtu 2Kb
action pipe overhead 0b
ref 1 bind 1
        Action statistics:
        Sent 98000 bytes 1000 pkt (dropped 0, overlimits 761 requeues 0)
        backlog 0b 0p requeues 0

        action order 2: gact action pass
         random type none pass val 0
         index 2 ref 1 bind 1 installed 60 sec used 3 sec
        Action statistics:
        Sent 74578 bytes 761 pkt (dropped 0, overlimits 0 requeues 0)
        backlog 0b 0p requeues 0

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Tested-by: John Fastabend <john.r.fastabend@intel.com>
9 years agoactions: BugFix action stats to display with -s
Jamal Hadi Salim [Sun, 21 Sep 2014 16:29:14 +0000 (12:29 -0400)]
actions: BugFix action stats to display with -s

Was broken by commit 288abf513f5d11b98f09c6977d2019097afb7e9f
Lets not be too clever and have a separate call to print flushed
actions info.

Broken looks like:
root@moja-1:~# tc actions add  action drop index 4
root@moja-1:~# tc -s actions ls action gact

    action order 0: gact action drop
     random type none pass val 0
     index 4 ref 1 bind 0 installed 9 sec used 4 sec

The fixed version looks like:
    action order 0: gact action drop
     random type none pass val 0
     index 4 ref 1 bind 0 installed 9 sec used 4 sec
         Sent 108948 bytes 1297 pkts (dropped 1297, overlimits 0)

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
9 years agoadd bridge master device support
Jiri Pirko [Sun, 28 Sep 2014 23:33:29 +0000 (16:33 -0700)]
add bridge master device support

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoadd bridge_slave device support
Jiri Pirko [Sun, 28 Sep 2014 23:31:04 +0000 (16:31 -0700)]
add bridge_slave device support

Note this depends on "iproute2: allow to change slave options via
type_slave"

9 years agoupdate headers to 3.17.0 net-next
Stephen Hemminger [Sun, 28 Sep 2014 23:28:00 +0000 (16:28 -0700)]
update headers to 3.17.0 net-next

9 years agoiproute2: VTI6 support for ip -6 link command.
Steffen Klassert [Fri, 26 Sep 2014 07:11:37 +0000 (09:11 +0200)]
iproute2: VTI6 support for ip -6 link command.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
9 years agoiproute2: Add support for IPv6 VTI tunnels to ip6tunnel
Steffen Klassert [Fri, 26 Sep 2014 07:10:56 +0000 (09:10 +0200)]
iproute2: Add support for IPv6 VTI tunnels to ip6tunnel

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
9 years agoip tuntap: Added missing commands in usage
vadimk [Tue, 16 Sep 2014 21:24:11 +0000 (00:24 +0300)]
ip tuntap: Added missing commands in usage

show, list, lst and help commands were not printed in usage.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip tuntap: Add checking if tun/tap mode was set by default
vadimk [Tue, 16 Sep 2014 20:54:34 +0000 (23:54 +0300)]
ip tuntap: Add checking if tun/tap mode was set by default

This checking was performed only when adding interface but
it is needed also when deleting, otherwise the error will be:

    ioctl(TUNSETIFF): Invalid argument

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip/vxlan: fix display of maxaddress option
Nicolas Dichtel [Tue, 9 Sep 2014 14:55:11 +0000 (16:55 +0200)]
ip/vxlan: fix display of maxaddress option

Parenthesis are required else maxaddr value is a bool and thus output is always
1 when the option is set.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoip/vxlan: add a help for ageing and maxaddress options
Nicolas Dichtel [Tue, 9 Sep 2014 14:55:10 +0000 (16:55 +0200)]
ip/vxlan: add a help for ageing and maxaddress options

These options were missing in usage and man pages.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
9 years agoadd help command to bonding master
Jiri Pirko [Fri, 5 Sep 2014 13:24:16 +0000 (15:24 +0200)]
add help command to bonding master

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoiproute2: allow to change slave options via type_slave
Nikolay Aleksandrov [Wed, 3 Sep 2014 15:57:30 +0000 (17:57 +0200)]
iproute2: allow to change slave options via type_slave

This patch adds the necessary changes to allow altering a slave device's
options via ip link set <device> type <master type>_slave specific-option.
It also adds support to set the bonding slaves' queue_id.

Example:
 ip link set eth0 type bond_slave queue_id 10

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
9 years agoiplink: forbid negative ifindex and modifying ifindex
WANG Cong [Fri, 5 Sep 2014 23:36:14 +0000 (16:36 -0700)]
iplink: forbid negative ifindex and modifying ifindex

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
9 years agoip: support of usec rtt in tcp_metrics
Eric Dumazet [Fri, 5 Sep 2014 23:54:04 +0000 (16:54 -0700)]
ip: support of usec rtt in tcp_metrics

Starting from linux-3.15, kernel supports new tcp metric attributes :
TCP_METRIC_RTT_US & TCP_METRIC_RTTVAR_US

Update ip command to detect their use.

Signed-off-by: Eric Dumazet <edumazet@google.com>
9 years agoip monitor: Skip IPv6 ND user option messages
vadimk [Thu, 4 Sep 2014 20:24:22 +0000 (23:24 +0300)]
ip monitor: Skip IPv6 ND user option messages

IPv6 router sends ND messages with RDNSS option
which causes the printing of unknown message by 'ip monitor':

    Unknown message: 0000004c 00000044 00000000

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoip monitor: Dont print timestamp or banner-label for cloned routes
vadimk [Thu, 4 Sep 2014 19:48:08 +0000 (22:48 +0300)]
ip monitor: Dont print timestamp or banner-label for cloned routes

This is ugly fix but solves the case when timestamp
or banner-label is printed before the cloned route will be skipped
by iproute filter which filters out all cached routes by default.
In such case timestamp will be printed twice:

    Timestamp: Thu Sep  4 19:46:59 2014 457933 usec
    Timestamp: Thu Sep  4 19:47:07 2014 977970 usec
    10.3.5.1 dev wlp3s0 lladdr XX:XX:XX:XX:XX:XX STALE

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
9 years agoupdate dsfield file values
Stephen Hemminger [Mon, 15 Sep 2014 03:40:37 +0000 (20:40 -0700)]
update dsfield file values

Update the rt_dsfield file to contain values defined in current RFC.
The days of TOS precedence are gone, even Cisco doesn't refer
to these in the documents.

9 years agoip link: Remove unnecessary device checking
vadimk [Sat, 30 Aug 2014 12:06:00 +0000 (15:06 +0300)]
ip link: Remove unnecessary device checking

The real checking is performed later in iplink_modify(..) func which
checks device existence if NLM_F_CREATE flag is set.

Also it fixes the case when impossible to add veth link which was
caused by 9a02651a87 (ip: check for missing dev arg when doing VF rate)
because these devices are not exist yet.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoip man: Added short description for hsr link type
vadimk [Sat, 30 Aug 2014 22:57:48 +0000 (01:57 +0300)]
ip man: Added short description for hsr link type

For hsr link there was no short description in ip-link man page.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoip netns: Show error message if mkdir failed to create /var/run/netns
vadimk [Thu, 28 Aug 2014 13:56:03 +0000 (16:56 +0300)]
ip netns: Show error message if mkdir failed to create /var/run/netns

Currently if mkdir failed with "Permission denied" error then "mount --make-shared ..."
error message will be showed because /var/run/netns does not exist.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agonstat: 64bit support on 32bit arches
Eric Dumazet [Mon, 25 Aug 2014 14:27:54 +0000 (07:27 -0700)]
nstat: 64bit support on 32bit arches

SNMP counters can be provided as 64bit numbers.
nstat needs to cope with this even if running in 32bit mode.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoll_types: add netlink ARPHRD
Daniel Borkmann [Sat, 23 Aug 2014 15:13:29 +0000 (17:13 +0200)]
ll_types: add netlink ARPHRD

This adds ARPHRD_NETLINK to ll_types so that it can be properly
shown e.g. in `ip a`:

 8: nlmon: <NOARP,UP,LOWER_UP> mtu 3776 qdisc noqueue state UNKNOWN group default
    link/netlink

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoMerge branch 'net-next'
Stephen Hemminger [Mon, 4 Aug 2014 19:58:36 +0000 (12:58 -0700)]
Merge branch 'net-next'

9 years agov3.16.0
Stephen Hemminger [Mon, 4 Aug 2014 19:43:46 +0000 (12:43 -0700)]
v3.16.0

9 years agoiproute2: allow to ipv6 set address generation mode
Jiri Pirko [Fri, 11 Jul 2014 19:11:46 +0000 (21:11 +0200)]
iproute2: allow to ipv6 set address generation mode

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
9 years agoUpdate kernel headers to net-next
Stephen Hemminger [Mon, 4 Aug 2014 19:39:49 +0000 (12:39 -0700)]
Update kernel headers to net-next

9 years agocleanup warnings
Stephen Hemminger [Mon, 4 Aug 2014 17:30:35 +0000 (10:30 -0700)]
cleanup warnings

ll_index can return -1 but was declared unsigned.
rt_addr_n2a had unused length parameter

9 years agotc/netem: loss gemodel options fixes
Jay Vosburgh [Sat, 10 May 2014 20:34:58 +0000 (13:34 -0700)]
tc/netem: loss gemodel options fixes

First, the default value for 1-k is documented as being 0, but is
currently being set to 1. (100%).  This causes all packets to be dropped
in the good state if 1-k is not explicitly specified.  Fix this by setting
the default to 0.

Second, the 1-h option is parsed correctly, however, the kernel is
expecting "h", not 1-h.  Fix this by inverting the "1-h" percentage before
sending to and after receiving from the kernel.  This does change the
behavior, but makes it consistent with the netem documentation and the
literature on the Gilbert-Elliot model, which refer to "1-h" and "1-k,"
not "h" or "k" directly.

Last, fix a minor formatting issue for the options reporting.

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
9 years agoiproute2 bridge: bring to above par with brctl show macs
Jamal Hadi Salim [Fri, 4 Jul 2014 12:37:10 +0000 (08:37 -0400)]
iproute2 bridge: bring to above par with brctl show macs

root@moja-mojo:bridge# ./bridge fdb help
Usage: bridge fdb { add | append | del | replace } ADDR dev DEV {self|master} [ temp ]
              [router] [ dst IPADDR] [ vlan VID ]
              [ port PORT] [ vni VNI ] [via DEV]
       bridge fdb {show} [ br BRDEV ] [ brport DEV ]

 Lets start with two bridges each with a port...

root@moja-mojo:bridge# ./bridge link
10: sw1-p1 state DOWN : <BROADCAST,NOARP> mtu 1500 master sw1 state disabled priority 32 cost 100
11: eth1 state DOWN : <BROADCAST,NOARP> mtu 1500 master br0 state disabled priority 32 cost 100

show all...
root@moja-mojo:bridge# ./bridge fdb show
33:33:00:00:00:01 dev ifb0 self permanent
33:33:00:00:00:01 dev ifb1 self permanent
33:33:00:00:00:01 dev eth0 self permanent
01:00:5e:00:00:01 dev eth0 self permanent
33:33:ff:92:c0:60 dev eth0 self permanent
33:33:00:00:00:fb dev eth0 self permanent
01:00:5e:00:00:fb dev eth0 self permanent
01:00:5e:7f:ff:fd dev eth0 self permanent
01:00:5e:00:00:01 dev wlan0 self permanent
33:33:00:00:00:01 dev wlan0 self permanent
33:33:ff:c2:84:3b dev wlan0 self permanent
33:33:00:00:00:fb dev wlan0 self permanent
01:00:5e:00:00:01 dev virbr0 self permanent
01:00:5e:00:00:fb dev virbr0 self permanent
33:33:00:00:00:01 dev br0 self permanent
33:33:00:00:00:01 dev sw1 self permanent
33:33:00:00:00:01 dev dummy0 self permanent
5e:f4:03:44:da:9a dev sw1-p1 vlan 0 master sw1 permanent
33:33:00:00:00:01 dev sw1-p1 self permanent
b6:5e:dd:ce:d7:5e dev eth1 vlan 0 master br0 permanent
33:33:00:00:00:01 dev eth1 self permanent

Lets see a netdev that is *not* attached to a bridge

root@moja-mojo:bridge# ./bridge fdb show brport eth0
33:33:00:00:00:01 self permanent
01:00:5e:00:00:01 self permanent
33:33:ff:92:c0:60 self permanent
33:33:00:00:00:fb self permanent
01:00:5e:00:00:fb self permanent
01:00:5e:7f:ff:fd self permanent

Lets see a netdev that is bridge port
root@moja-mojo:bridge# ./bridge fdb show brport eth1
hadi@jhs-1:/media/MT1/other-gits/iproute-jul04/bridge$ ./bridge fdb show brport eth1
b6:5e:dd:ce:d7:5e vlan 0 master br0 permanent
33:33:00:00:00:01 self permanent

Specify the correct bridge and you get good stuff
root@moja-mojo:bridge# ./bridge fdb show brport eth1 br br0
6:5e:dd:ce:d7:5e vlan 0 master br0 permanent
33:33:00:00:00:01 self permanent

Specify the wrong bridge and you get good nada
root@moja-mojo:bridge# ./bridge fdb show brport eth1 br sw1

dump br0
root@moja-mojo:bridge# ./bridge fdb show br br0
33:33:00:00:00:01 dev br0 self permanent
b6:5e:dd:ce:d7:5e dev eth1 vlan 0 master br0 permanent
33:33:00:00:00:01 dev eth1 self permanent

dump sw1
root@moja-mojo:bridge# ./bridge fdb show br sw1
33:33:00:00:00:01 dev sw1 self permanent
5e:f4:03:44:da:9a dev sw1-p1 vlan 0 master sw1 permanent
33:33:00:00:00:01 dev sw1-p1 self permanent

Lets move a port from one bridge to another for shits-and-giggles
(as the New Brunswickians like to say)
root@moja-mojo:bridge# ip link set sw1-p1 master br0

Now dump again br0
root@moja-mojo:bridge# ./bridge fdb show br br0
33:33:00:00:00:01 dev br0 self permanent
5e:f4:03:44:da:9a dev sw1-p1 vlan 0 master br0 permanent
33:33:00:00:00:01 dev sw1-p1 self permanent
b6:5e:dd:ce:d7:5e dev eth1 vlan 0 master br0 permanent
33:33:00:00:00:01 dev eth1 self permanent

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>