]> git.ipfire.org Git - thirdparty/iproute2.git/log
thirdparty/iproute2.git
11 years agoFix handling of qdis without options
Stephen Hemminger [Sun, 27 Oct 2013 19:26:47 +0000 (12:26 -0700)] 
Fix handling of qdis without options

Some qdisc like htb want the parse_qopt to be called even if no options
present. Fixes regression caused by:

e9e78b0db0e023035e346ba67de838be851eb665 is the first bad commit
commit e9e78b0db0e023035e346ba67de838be851eb665
Author: Stephen Hemminger <stephen@networkplumber.org>
Date:   Mon Aug 26 08:41:19 2013 -0700

    tc: allow qdisc without options

11 years agoiplink: update available type list
Nicolas Dichtel [Tue, 8 Oct 2013 14:59:45 +0000 (07:59 -0700)] 
iplink: update available type list

macvtap and vti were missing.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
11 years agoxfrm: enable to set non-wildcard mark 0 on SAs and SPs
Christophe Gouault [Tue, 8 Oct 2013 12:56:54 +0000 (05:56 -0700)] 
xfrm: enable to set non-wildcard mark 0 on SAs and SPs

ip xfrm considers that the user-defined mark is "any" as soon as
(mark.v & mark.m == 0), which prevents from specifying non-wildcard
marks that include the value 0 (typically 0/0xffffffff).

Yet, matching exactly mark 0 is useful for instance to separate
vti policies from global policies.

Always configure the user mark if mark.m != 0.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
11 years agoiproute2: ip6gre: update man pages
xeb@mail.ru [Tue, 1 Oct 2013 07:18:34 +0000 (11:18 +0400)] 
iproute2: ip6gre: update man pages

Update man pages with ip6gre info.

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
11 years agoipv6 gre: add entry to ether types
Stephen Hemminger [Tue, 1 Oct 2013 04:40:05 +0000 (21:40 -0700)] 
ipv6 gre: add entry to ether types

11 years agoiproute2: GRE over IPv6 tunnel support.
xeb@mail.ru [Sat, 28 Sep 2013 07:32:51 +0000 (11:32 +0400)] 
iproute2: GRE over IPv6 tunnel support.

GRE over IPv6 tunnel support.

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
11 years agoaction: typo nat fix
Jamal Hadi Salim [Sun, 29 Sep 2013 11:39:23 +0000 (07:39 -0400)] 
action: typo nat fix

If you taketh you giveth.
I Went the LinuxWay and copied this for m_simple.c and noticed
this one typo (I wonder where it came from?;->).

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
11 years agotc: introduce simple action
Jamal Hadi Salim [Sun, 29 Sep 2013 11:33:42 +0000 (07:33 -0400)] 
tc: introduce simple action

Simple action is already in the kernel for years now as an
example. This complements it with user space control.

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
11 years agotc: add default action to kernel headers
Stephen Hemminger [Tue, 1 Oct 2013 04:28:09 +0000 (21:28 -0700)] 
tc: add default action to kernel headers

11 years agoxfrm: use memcpy to suppress gcc phony buffer overflow warning.
Fan Du [Tue, 1 Oct 2013 04:09:05 +0000 (21:09 -0700)] 
xfrm: use memcpy to suppress gcc phony buffer overflow warning.

This bug is reported from below link:
https://bugzilla.redhat.com/show_bug.cgi?id=982761

An simplified command from its original reproducing method in bugzilla:
ip xfrm state add src 10.0.0.2 dst 10.0.0.1 proto ah spi 0x12345678 auth md5 12
will cause below spew from gcc.

Reported-by: Sohny Thomas <sthomas@linux.vnet.ibm.com>
11 years agoiproute2: bridge: Close file with bridge monitor file
Petr Písař [Wed, 25 Sep 2013 07:45:45 +0000 (09:45 +0200)] 
iproute2: bridge: Close file with bridge monitor file

The `bridge monitor file FILENAME' reads dumped netlink messages from
a file. But it forgot to close the file after using it. This patch
fixes it.

Signed-off-by: Petr Písař <ppisar@redhat.com>
11 years agolnstat, nstat, ifstat: update man pages
Stephen Hemminger [Tue, 24 Sep 2013 19:00:41 +0000 (12:00 -0700)] 
lnstat, nstat, ifstat: update man pages

New json option

11 years agolnstat: add json output format
Stephen Hemminger [Tue, 24 Sep 2013 18:55:27 +0000 (11:55 -0700)] 
lnstat: add json output format

11 years agoifstat: add json output format
Stephen Hemminger [Tue, 24 Sep 2013 18:55:13 +0000 (11:55 -0700)] 
ifstat: add json output format

11 years agonstat: revise json output
Stephen Hemminger [Tue, 24 Sep 2013 18:54:45 +0000 (11:54 -0700)] 
nstat: revise json output

Also add long options

11 years agoMerge /tmp/iproute2
Stephen Hemminger [Tue, 24 Sep 2013 17:17:18 +0000 (10:17 -0700)] 
Merge /tmp/iproute2

11 years agoMerge branch 'net-next-3.11'
Stephen Hemminger [Mon, 23 Sep 2013 20:16:48 +0000 (13:16 -0700)] 
Merge branch 'net-next-3.11'

11 years agoUpdate to 3.12-rc1 headers
Stephen Hemminger [Mon, 23 Sep 2013 20:15:49 +0000 (13:15 -0700)] 
Update to 3.12-rc1 headers

11 years agohtb: add support for direct_qlen attribute
Eric Dumazet [Fri, 13 Sep 2013 16:10:01 +0000 (09:10 -0700)] 
htb: add support for direct_qlen attribute

TCA_HTB_DIRECT_QLEN attribute is supported since linux-3.10

HTB classes use an internal pfifo queue, which limit was not reported
by tc, and value inherited from device tx_queue_len at setup time.

With this patch, tc displays the value and can change it.

Signed-off-by: Eric Dumazet <edumazet@google.com>
11 years agotc: support TCA_STATS_RATE_EST64
Eric Dumazet [Tue, 17 Sep 2013 11:19:03 +0000 (04:19 -0700)] 
tc: support TCA_STATS_RATE_EST64

Since linux-3.11, rate estimator can provide TCA_STATS_RATE_EST64
when rate (bytes per second) is above 2^32 (~34 Mbits)

Change tc to use this attribute for high rates.

Signed-off-by: Eric Dumazet <edumazet@google.com>
11 years agoiproute2: bridge: document mdb
Petr Písař [Thu, 19 Sep 2013 08:41:26 +0000 (10:41 +0200)] 
iproute2: bridge: document mdb

This augments bridge(8) manual page with `bridge mdb' and `bridge
monitor mdb' commands which have been added recently.

Signed-off-by: Petr Písař <ppisar@redhat.com>
11 years agopkt_sched: fq: Fair Queue packet scheduler
Eric Dumazet [Fri, 30 Aug 2013 02:30:36 +0000 (19:30 -0700)] 
pkt_sched: fq: Fair Queue packet scheduler

Support for FQ packet scheduler

$ tc qd add dev eth0 root fq help
Usage: ... fq [ limit PACKETS ] [ flow_limit PACKETS ]
              [ quantum BYTES ] [ initial_quantum BYTES ]
              [ maxrate RATE  ] [ buckets NUMBER ]
              [ [no]pacing ]

$ tc -s -d qd
qdisc fq 8002: dev eth0 root refcnt 32 limit 10000p flow_limit 100p
buckets 256 quantum 3028 initial_quantum 15140
 Sent 216532416 bytes 148395 pkt (dropped 0, overlimits 0 requeues 14)
 backlog 0b 0p requeues 14
  511 flows (511 inactive, 0 throttled)
  110 gc, 0 highprio, 0 retrans, 1143 throttled, 0 flows_plimit

limit : max number of packets on whole Qdisc (default 10000)

flow_limit : max number of packets per flow (default 100)

quantum : the max deficit per RR round (default is 2 MTU)

initial_quantum : initial credit for new flows (default is 10 MTU)

maxrate : max per flow rate (default : unlimited)

buckets : number of RB trees (default : 1024) in hash table.
               (consumes 8 bytes per bucket)

[no]pacing : disable/enable pacing (default is enable)

Usage :

tc qdisc add dev $ETH root fq

tc qdisc del dev $ETH root 2>/dev/null
tc qdisc add dev $ETH root handle 1: mq
for i in `seq 1 4`
do
  tc qdisc add dev $ETH parent 1:$i est 1sec 4sec fq
done

Signed-off-by: Eric Dumazet <edumazet@google.com>
11 years agonstat: add json output format
Stephen Hemminger [Fri, 13 Sep 2013 17:31:41 +0000 (10:31 -0700)] 
nstat: add json output format

New command line flag to output statistics in JSON format.
In our envrionment, we have scripts that parse output of commands.
It is better to use a format supported by existing parsers.

11 years agoUpdate to 3.11 net-next kernel headers
Stephen Hemminger [Tue, 3 Sep 2013 15:46:40 +0000 (08:46 -0700)] 
Update to 3.11 net-next kernel headers

11 years agoMerge branch 'master' into net-next-3.11
Stephen Hemminger [Tue, 3 Sep 2013 15:45:27 +0000 (08:45 -0700)] 
Merge branch 'master' into net-next-3.11

11 years agov3.11.0 v3.11.0
Stephen Hemminger [Tue, 3 Sep 2013 15:23:03 +0000 (08:23 -0700)] 
v3.11.0

11 years agolinklayer interface between kernel and tc/userspace
Jesper Dangaard Brouer [Fri, 30 Aug 2013 12:02:10 +0000 (14:02 +0200)] 
linklayer interface between kernel and tc/userspace

This iproute2 tc patch is connected to the kernel
 - commit 8a8e3d84b17 (net_sched: restore "linklayer atm" handling)

The rate table calculated by tc, have gotten replaced in the kernel
and is no-longer used for lookups.

This happened in kernel release v3.8 caused by kernel
 - commit 56b765b79 ("htb: improved accuracy at high rates").
This change unfortunately caused breakage of tc overhead and
linklayer parameters.

 Kernel overhead handling got fixed in kernel v3.10 by
 - commit 01cb71d2d47 (net_sched: restore "overhead xxx" handling)

 Kernel linklayer handling got fixed in kernel v3.11 by
 - commit 8a8e3d84b17 (net_sched: restore "linklayer atm" handling)

The linklayer fix introduced a struct change, that allow the linklayer
attribute to be transferred between tc and kernel. This patch make use
of this linklayer attribute.

The linklayer setting is transfer to the kernel.  And linklayer
setting received from the kernel is printed with a prefixed
"linklayer" when listing current configuration.  The default
TC_LINKLAYER_ETHERNET is only printed in detailed output mode.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
11 years agoipnetns: fix ip batch mode when using 'netns exec'
Nicolas Dichtel [Thu, 29 Aug 2013 12:29:07 +0000 (14:29 +0200)] 
ipnetns: fix ip batch mode when using 'netns exec'

Since commit a05f6511f543, ip batch mode is broken when using 'netns exec' cmd.

When WIFEXITED() returns true, it means that the child exited normally, hence
we must not call exit() but just returns the status. If we call exit, the next
commands in the file file are not executed.
If WIFEXITED() returns false, we can call exit() because it means that the
child failed.

This patch partially reverts commit a05f6511f543.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
11 years agoUpdate kernel headers to 3.11
Stephen Hemminger [Tue, 3 Sep 2013 15:18:25 +0000 (08:18 -0700)] 
Update kernel headers to 3.11

Last minute addition to pkt_sched.h

11 years agoip/xfrm: Fix potential SIGSEGV when printing extra flags
Thomas Egerer [Thu, 29 Aug 2013 12:00:36 +0000 (14:00 +0200)] 
ip/xfrm: Fix potential SIGSEGV when printing extra flags

The git-commit dc8867d0, that added support for displaying the
extra-flags of a state, introduced a potential segfault.
Trying to show a state without the extra-flag attribute and show_stats
enabled, would cause the NULL pointer in tb[XFRMA_SA_EXTRA_FLAGS] to be
dereferenced.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
11 years agomacvlan: fix typo in macvlan_print_opt()
Lutz Jaenicke [Thu, 29 Aug 2013 07:50:28 +0000 (09:50 +0200)] 
macvlan: fix typo in macvlan_print_opt()

The mode information is contained in IFLA_MACVLAN_MODE instead
of IFLA_VLAN_ID (both evaluating to "1" in their enums).

Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
11 years agoiproute2: ip-route.8.in: minor fixes
Richard Godbee [Mon, 26 Aug 2013 02:40:19 +0000 (22:40 -0400)] 
iproute2: ip-route.8.in: minor fixes

In SYNOPSIS section:

 - Add 'reordering'
 - Add missing '[' before 'quickack'

Signed-off-by: Richard Godbee <richard@godbee.net>
11 years agoiproute2: spelling: noptmudisc -> nopmtudisc
Richard Godbee [Mon, 26 Aug 2013 02:40:18 +0000 (22:40 -0400)] 
iproute2: spelling: noptmudisc -> nopmtudisc

Signed-off-by: Richard Godbee <richard@godbee.net>
11 years agoiproute2: iproute.c: fix usage() spacing problems
Richard Godbee [Mon, 26 Aug 2013 02:19:11 +0000 (22:19 -0400)] 
iproute2: iproute.c: fix usage() spacing problems

Fix two spacing problems around square brackets in usage text.

Signed-off-by: Richard Godbee <richard@godbee.net>
11 years agoadd ability to filter neighbour discovery by protocol
Stephen Hemminger [Thu, 29 Aug 2013 19:18:52 +0000 (12:18 -0700)] 
add ability to filter neighbour discovery by protocol

Useful to be able to monitor arp and IPv6 nd seperately.
Default is both.

11 years agotc: allow qdisc without options
Stephen Hemminger [Mon, 26 Aug 2013 15:41:19 +0000 (08:41 -0700)] 
tc: allow qdisc without options

Pfifo_fast needs no options. So don't force it to have parsing code.

11 years agoip: Add label option to ip monitor
Martin Schwenke [Mon, 19 Aug 2013 05:43:30 +0000 (15:43 +1000)] 
ip: Add label option to ip monitor

Prefix labelling is currently only activated when monitoring "all"
objects.  However, the output can still be confusing when monitoring
more than 1 object, so add an option to always print prefix labels.

Signed-off-by: Martin Schwenke <martin@meltin.net>
12 years agoMore minor spelling fixes
Stephen Hemminger [Sun, 4 Aug 2013 22:10:05 +0000 (15:10 -0700)] 
More minor spelling fixes

12 years agoFix spelling errors
Stephen Hemminger [Sun, 4 Aug 2013 22:00:56 +0000 (15:00 -0700)] 
Fix spelling errors

Minor errors found by codespell

12 years agocleanup help message
Stephen Hemminger [Sun, 4 Aug 2013 22:00:42 +0000 (15:00 -0700)] 
cleanup help message

Split it naturally

12 years agoiproute vxlan add support for fdb replace command
Thomas Richter [Tue, 30 Jul 2013 06:16:41 +0000 (08:16 +0200)] 
iproute vxlan add support for fdb replace command

Add support for the bridge fdb replace command to replace an
existing entry in the vxlan device driver forwarding data base.
The entry is identified with its unicast mac address and its
corresponding remote destination information is updated.

This is useful for virtual machine migration and replaces the
bridge fdb del and bridge fdb add commands.

It follows the same interface as ip neigh replace commands.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
12 years agoip rule: add route suppression options
Stefan Tomanek [Sat, 3 Aug 2013 12:23:16 +0000 (14:23 +0200)] 
ip rule: add route suppression options

When configuring a system with multiple network uplinks and default routes, it
is often convenient to reference a routing table multiple times - but reject
its routing decision if certain constraints are not met by it.

Consider this setup:

$ ip route add table secuplink default via 10.42.23.1

$ ip rule add pref 100            table main suppress_prefixlength 0
$ ip rule add pref 150 fwmark 0xA table secuplink

With this setup, packets marked 0xA will be processed by the additional routing
table "secuplink", but only if no suitable route in the main routing table can
be found. By suppressing entries with a prefixlength of 0 (or less), the
default route (/0) of the table "main" is hidden to packets processed by rule
100; packets traveling to destinations via more specific routes are processed
as usual.

It is also possible to suppress a routing entry if a device belonging to
a specific interface group is to be used:

$ ip rule add pref 150 table main suppress_group 1

Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
12 years agoMerge branch 'master' into net-next-3.11
Stephen Hemminger [Sun, 4 Aug 2013 18:53:10 +0000 (11:53 -0700)] 
Merge branch 'master' into net-next-3.11

12 years agoip link: fix display of interface groups
Stefan Tomanek [Sat, 3 Aug 2013 12:20:53 +0000 (14:20 +0200)] 
ip link: fix display of interface groups

This change adds the interface group to the output of "ip link show".

It also makes "ip link" print _all_ devices if no group filter is specified;
previously, only interfaces of the default group (0) were shown.

Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
12 years agoUpdate kernel headers to net-next for 3.12
Stephen Hemminger [Sun, 4 Aug 2013 18:43:02 +0000 (11:43 -0700)] 
Update kernel headers to net-next for 3.12

12 years agoRemove -Werror
Stephen Hemminger [Thu, 1 Aug 2013 00:42:39 +0000 (17:42 -0700)] 
Remove -Werror

-Werror just doesn't work because it changes too much
between compiler versions.

12 years agoip: allow to specify mode for sit tunnels
Nicolas Dichtel [Tue, 16 Jul 2013 20:54:14 +0000 (22:54 +0200)] 
ip: allow to specify mode for sit tunnels

It's now possible to have IPv4 and IPv6 over IPv4 tunnels with the module sit.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
12 years agoipadress: fix display of IPv6 peer address
Nicolas Dichtel [Tue, 16 Jul 2013 20:52:48 +0000 (22:52 +0200)] 
ipadress: fix display of IPv6 peer address

Because only IPv4 was supported, the size was static. Now, IPv6 also supports
peer address.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
12 years agovxlan: Allow setting destination to unicast address.
Atzm Watanabe [Wed, 24 Jul 2013 05:01:01 +0000 (14:01 +0900)] 
vxlan: Allow setting destination to unicast address.

This patch allows setting VXLAN destination to unicast address.
It allows that VXLAN can be used as peer-to-peer tunnel without
multicast.

v6: change back to the v3 except for using new attribute because
    replacing command-line parameters breaks existing scripts,
    based by Cong Wang's comments.

v5: rebase on the latest.

v4: replace "group" with "remote" based by David Stevens's comments.

v3: move a new attribute REMOTE into the last of an enum list
    based by Stephen Hemminger's comments.
    fix the usage to show explicitly that both "remote" and "group"
    cannot be specified, based by Ben Hutchings's comments.

v2: use a new argument "remote" instead of "group" based by
    Stephen Hemminger's comments.

Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp>
12 years agoMerge branch 'net-next-3.10'
Stephen Hemminger [Tue, 16 Jul 2013 17:20:31 +0000 (10:20 -0700)] 
Merge branch 'net-next-3.10'

12 years agoUpdate to 3.11-rc1 kernel headers
Stephen Hemminger [Tue, 16 Jul 2013 17:19:56 +0000 (10:19 -0700)] 
Update to 3.11-rc1 kernel headers

Sanitized headers from upstream

12 years agov3.10.0 v3.10.0
Stephen Hemminger [Tue, 16 Jul 2013 17:06:36 +0000 (10:06 -0700)] 
v3.10.0

12 years agoMake tc and ip batch mode consistent
Stephen Hemminger [Tue, 16 Jul 2013 17:04:05 +0000 (10:04 -0700)] 
Make tc and ip batch mode consistent

Change the code for tc and ip so that batch mode is handled
the same.

12 years agoip: add batch mode to man page
Stephen Hemminger [Sat, 13 Jul 2013 17:02:03 +0000 (10:02 -0700)] 
ip: add batch mode to man page

12 years agonetns: follow return value conventions of the rest of the code
Stephen Hemminger [Fri, 12 Jul 2013 15:43:23 +0000 (08:43 -0700)] 
netns: follow return value conventions of the rest of the code

The netns code was using EXIT_SUCCESS/EXIT_FAILURE but the rest of the ip
code used -1 explictly, so change to follow convention. Also, certain types
of errors like fork failure should abort a batch operation, rather than just
returning an error.

12 years agoip-rule.8: Fix presentational use of .SS.
esr@thyrsus.com [Wed, 10 Jul 2013 04:49:35 +0000 (00:49 -0400)] 
ip-rule.8: Fix presentational use of .SS.

12 years agoIn tc-ematch.8, remove no-op .ti requests to prevent translation warnings
esr@thyrsus.com [Wed, 10 Jul 2013 00:13:06 +0000 (20:13 -0400)] 
In tc-ematch.8, remove no-op .ti requests to prevent translation warnings

These do nothing on an 80-column display. They were clearly somebody's
boilerplate way of setting up hanging indents, but the syntax lines
are way too short to require them. And since most were argumentless
they would have been no-ops on any sized display.

12 years agoiproute2 vxlan documentation update for ip command
Thomas Richter [Mon, 8 Jul 2013 12:05:43 +0000 (14:05 +0200)] 
iproute2 vxlan documentation update for ip command

The ip link command line help and the ip-link.8.in
man page are outdated in regards to the vxlan support.
The patch updates both the command line help for the
ip command and its man page.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
12 years agoiproute2 vxlan documentation update for bridge command
Thomas Richter [Fri, 5 Jul 2013 07:08:50 +0000 (09:08 +0200)] 
iproute2 vxlan documentation update for bridge command

The bridge fdb command line help and the bridge.8
man page are outdated in regards to the vxlan support.
The patch updates both the command line help for the
bridge command and its man page.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
12 years agoipbatch: fix use of 'ip netns exec'
JunweiZhang [Tue, 9 Jul 2013 15:55:20 +0000 (08:55 -0700)] 
ipbatch: fix use of 'ip netns exec'

execvp() does not return when the command succeed, hence all commands in the
batch file after the line 'ip netns exec' are not executed.

Let's fork before calling execvp() if batch mode is used..

Example:
$ cat test.batch
netns add netns1
netns exec netns1 ip l
netns
$ ip -b test.batch
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT
    link/sit 0.0.0.0 brd 0.0.0.0

All command after 'netns exec' are never executed.

With the patch:
$ ip -b test.batch
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT
    link/sit 0.0.0.0 brd 0.0.0.0
netns1

Now, existing netns are displayed.

Signed-off-by: JunweiZhang <junwei.zhang@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
12 years agoiptunnel: check SIT_ISATAP flag only for SIT tunnel
Amerigo Wang [Tue, 2 Jul 2013 09:39:28 +0000 (17:39 +0800)] 
iptunnel: check SIT_ISATAP flag only for SIT tunnel

Without patch, I got:

# ./ip/ip tunnel show
ip_vti0: ioctl 89f4 failed: Invalid argument
ip_vti0: ip/ip  remote any  local any  ttl inherit  nopmtudisc key 0

this is due to VTI_ISVTI has the same numeric value with SIT_ISATAP,
but only sit tunnel has SIOCGETPRL, therefore it should check for SIT
tunnel first.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cong Wang <amwang@redhat.com>
12 years agotc-stab.8: Fix synopsis errors, an invalid escape, and incorrect English usge.
esr@thyrsus.com [Mon, 1 Jul 2013 00:02:47 +0000 (20:02 -0400)] 
tc-stab.8: Fix synopsis errors, an invalid escape, and incorrect English usge.

The command synopsis is regularized and part of it split off into an
OPTIONS section.  This allows the page to lift to XML-DocBook.

An invalid \p escape was removed.

This page was written by someone who didn't understand the use of
definite and indefinite articles in English, nor its punctuation rules.
I've fixed these mistakes, and some glitches in punctuation and
capitalization.

12 years agoip: fix build failure if time_t is not long int
Adam Borowski [Mon, 24 Jun 2013 23:39:21 +0000 (01:39 +0200)] 
ip: fix build failure if time_t is not long int

This includes x32, and, per Linus' decree, any future arch with longs
shorter than 64 bits.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
12 years agoss: add more TCP_INFO components
Eric Dumazet [Tue, 25 Jun 2013 20:29:17 +0000 (13:29 -0700)] 
ss: add more TCP_INFO components

Allow ss -i to display more TCP informations :

unacked:N   Number of un-acked packets
retrans:X/Y   X: number of outstanding retransmit packets
              Y: total number of retransmits for the session
lost:N       Number of lost packets (tcpi_lost)
sacked:N     Number of sacked packets (tcpi_sacked)
facked:N     Number of facked packets (tcpi_facked)
reordering:N Reordering level (if different of 3)

Example :

$ ss -emoi dst 10.7.7.83
tcp   ESTAB      0      1154056   10.7.7.84:54127    10.7.7.83:34342
timer:(on,200ms,0) ino:57003 sk:ffff88063c51d0c0 <->
 skmem:(r0,rb89280,t0,tb2097152,f726504,w1436184,o0,bl0) ts sack cubic
wscale:7,6 rto:310 rtt:107.375/1 mss:1448 cwnd:568 ssthresh:108 send
61.3Mbps unacked:568 retrans:0/21 reordering:127 rcv_space:29200

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
12 years agoFirst set of manpage markup fixes
esr@thyrsus.com [Fri, 21 Jun 2013 19:57:21 +0000 (15:57 -0400)] 
First set of manpage markup fixes

Enclosed patch fixes inappropriate uses of the .SS macro.  Fuller explanation
in the change comment.

There are other problems in these pages that block lifting to
XML-DocBook, most notably in the command synopses.  They will take
some creativity to fix.  I'm working on it

>From 75745adba4b45b87577b61a2daa886dd444f44da Mon Sep 17 00:00:00 2001
From: "Eric S. Raymond" <esr@thyrsus.com>
Date: Fri, 21 Jun 2013 15:27:38 -0400
Subject: [PATCH] Abolish presentation-level misuse of the .SS macro.

This change fixes most (but not all) fatal errors in attempts to lift
the iproute2 manual pages to XML-DocBook.  Where .SS is still used it
is a real subsection header, not just a way to outdent and bold text.
Presentation-level instances are turned into .TP calls and tables.

12 years agoip: iplink_vlan: add 802.1ad support
Patric McHardy [Fri, 21 Jun 2013 15:59:24 +0000 (08:59 -0700)] 
ip: iplink_vlan: add 802.1ad support

The following patch adds support to ip_vlan for configuring VLAN 802.1ad
support.

Signed-off-by: Patrick McHardy <kaber@trash.net>
12 years agoadd quickack option to ip route
Cong Wang [Sat, 15 Jun 2013 01:39:19 +0000 (09:39 +0800)] 
add quickack option to ip route

This patch adds quickack option to enable/disable TCP quick ack
mode for per-route.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <amwang@redhat.com>
12 years agoAdd VF link state control
Rony Efraim [Thu, 13 Jun 2013 10:19:12 +0000 (13:19 +0300)] 
Add VF link state control

Add link state per VF command

Signed-off-by: Rony Efraim <ronye@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
12 years agoupdate to 3.10-net-next headers
Stephen Hemminger [Thu, 20 Jun 2013 01:14:17 +0000 (18:14 -0700)] 
update to 3.10-net-next headers

12 years agoget_rate: detect 32bit overflows
Eric Dumazet [Mon, 3 Jun 2013 05:51:33 +0000 (05:51 +0000)] 
get_rate: detect 32bit overflows

On Mon, 2013-06-03 at 16:36 +0100, Ben Hutchings wrote:

> Oops, I read this as being strtol() currently, not strtod().  Currently
> '1.5gbit' will work, but this change will break that.  So I think you
> need to keep bps as a double.

Arg

> Then here I think the check should be *rate != floor(bps), i.e. accept
> rounding down of a non-integer number of bytes but any other change is
> assumed to be overflow.

Thanks Ben, here is v4 then ;)

[PATCH v4] get_rate: detect 32bit overflows

Current rate limit is 34.359.738.360 bit per second, and
unfortunately 40Gbps links are above it.

overflows in get_rate() are currently not detected, and some
users are confused. Let's detect this and complain.

Note that some qdisc are ready to get extended range, but this will
need additional attributes and new iproute2

With help from Ben Hutchings

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
12 years agohtb: fix indentation
Stephen Hemminger [Fri, 7 Jun 2013 15:54:45 +0000 (08:54 -0700)] 
htb: fix indentation

iproute2 uses kernel style indenting

12 years agohtb: report overhead attribute
Eric Dumazet [Sun, 2 Jun 2013 11:33:01 +0000 (11:33 +0000)] 
htb: report overhead attribute

"tc class show dev ..." omits the overhead attribute for HTB.

After patch I have :

tc class add dev $DEV parent 1: classid 1:1 est 1sec 4sec htb \
    rate 12Mbit mtu 1500 quantum 1514 overhead 20

tc class show dev $DEV
class htb 1:1 root prio 0 rate 12000Kbit overhead 20 ceil 12000Kbit
burst 1500b cburst 1500b

Signed-off-by: Eric Dumazet <edumazet@google.com>
12 years agoss: Get netlink sockets info via sock-diag (v2)
Andrey Vagin [Wed, 5 Jun 2013 08:42:01 +0000 (12:42 +0400)] 
ss: Get netlink sockets info via sock-diag (v2)

v2: update netlink_diag.h

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
12 years agoss: show destination address for netlink sockets
Andrey Vagin [Wed, 5 Jun 2013 08:42:00 +0000 (12:42 +0400)] 
ss: show destination address for netlink sockets

A netlink socket may be connected to a specific group.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
12 years agoss: create a function to print info about netlink sockets
Andrey Vagin [Wed, 5 Jun 2013 08:41:59 +0000 (12:41 +0400)] 
ss: create a function to print info about netlink sockets

It will be reused for printing info about netlink sockets, when
socket diag is used for retrieving information.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
12 years agoss: handle socket diag request in a separate function
Andrey Vagin [Wed, 5 Jun 2013 08:41:58 +0000 (12:41 +0400)] 
ss: handle socket diag request in a separate function

It will be reused to show netlink sockets

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
12 years agoip: set the close-on-exec flag for descriptors
Andrey Vagin [Tue, 4 Jun 2013 08:01:14 +0000 (12:01 +0400)] 
ip: set the close-on-exec flag for descriptors

Otherwise a program executed by "ip netns exec" has two extra
descriptors.

$ ip netns exec test /bin/bash
$ lsof -p $$
...
bash    817 root    0u   CHR  136,0       0t0          3 /dev/pts/0
bash    817 root    1u   CHR  136,0       0t0          3 /dev/pts/0
bash    817 root    2u   CHR  136,0       0t0          3 /dev/pts/0
bash    817 root    3u  sock    0,6       0t0      13386 protocol: NETLINK
bash    817 root    4r   REG    0,3         0 4026532155 net
bash    817 root  255u   CHR  136,0       0t0          3 /dev/pts/0

Cc: Stephen Hemminger <stephen@networkplumber.org>
Reported-by: Dilip Daya <dilip.daya@hp.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
12 years agoiproute2: fix build failure on sparc due to -Wformat and tv_usec
Andreas Henriksson [Sat, 18 May 2013 06:18:51 +0000 (06:18 +0000)] 
iproute2: fix build failure on sparc due to -Wformat and tv_usec

tv_usec is "suseconds_t" which is apparently usually
a signed long, but sometimes not....
Change the printf modifier to use signed and
cast the tv_usec to long in case it's not already long.

gcc -Wall -Wstrict-prototypes -Werror -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -fPIC   -c -o utils.o utils.c
utils.c: In function 'print_timestamp':
utils.c:802:2: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type '__suseconds_t' [-Werror=format]
cc1: all warnings being treated as errors

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
12 years agoiproute2: bridge: fix 'bridge link' setlink/getlink parsing
John Fastabend [Wed, 29 May 2013 06:20:53 +0000 (06:20 +0000)] 
iproute2: bridge: fix 'bridge link' setlink/getlink parsing

Use IFLA_AF_SPEC nested attributes to lookup bridge mode and when
doing strcmp() check for equality.

These appear to be typos from the original commit,

commit 64108901b737b95247b53dec8c1b8217ca8505b7
Author: Vlad Yasevich <vyasevic@redhat.com>
Date:   Fri Mar 15 10:01:28 2013 -0700

    bridge: Add support for setting bridge port attributes

Also set flags to BRIDGE_FLAGS_SELF instead of using OR operation.
This allows setting the bridge mode when not being used with a
master device.

To allow setting both master and self devices simultaneously we
will need to add a {self|master} field similar to fdb commands.
For now the command sets are mutually exclusive as noted in the
original commit.

With this patch 'bridge link set' works now,

# ./bridge/bridge link set dev veth1 cost 3
# ./bridge/bridge link show
10: veth1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master bridge0 state forwarding priority 3 cost 3

CC: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
12 years agoman: get rid of useless reference to GNU style options
Stephen Hemminger [Tue, 28 May 2013 15:47:56 +0000 (08:47 -0700)] 
man: get rid of useless reference to GNU style options

No need to state the obvious here.

12 years agoiptuntap: allow creation of multi-queue tun/tap device
Sriram Narasimhan [Thu, 23 May 2013 12:36:29 +0000 (12:36 +0000)] 
iptuntap: allow creation of multi-queue tun/tap device

This patch adds multi_queue option to ip tuntap.
This allows IFF_MULTI_QUEUE flag to be specified during
tun/tap device creation enabling multi-queue support in tun/tap
device.

Example: ip tuntap add dev tap0 mode tap multi_queue

Signed-off-by: Sriram Narasimhan <sriram.narasimhan@hp.com>
12 years agoman: describe --bpf option of ss
Nicolas Dichtel [Fri, 24 May 2013 12:25:41 +0000 (14:25 +0200)] 
man: describe --bpf option of ss

This option has been recently added to ss utility.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
12 years agoss: replace bfp with bpf in usage().
Rami Rosen [Fri, 24 May 2013 09:42:40 +0000 (12:42 +0300)] 
ss: replace bfp with bpf in usage().

This patch fixes usage() of misc/ss.c to use bpf instead of bfp.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
12 years agovxlan: remove dstport option
Stephen Hemminger [Thu, 23 May 2013 17:21:15 +0000 (10:21 -0700)] 
vxlan: remove dstport option

Dstport option does not work as expected in 3.10
It only allows setting port for sending and does not enable incoming
receive.

12 years agoss: Show inet and unix sockets' shutdown state
Pavel Emelyanov [Fri, 17 May 2013 15:02:14 +0000 (08:02 -0700)] 
ss: Show inet and unix sockets' shutdown state

When extended info is requested (-e option) one will be able to observe
arrows in the output, like this:

ESTAB 0 0  127.0.0.1:41705  127.0.0.1:12345  ino:143321 sk:ffff88003a8cea00 -->
ESTAB 0 0  127.0.0.1:46925  127.0.0.1:12346  ino:143322 sk:ffff88003a8ce4c0 <--
ESTAB 0 0  127.0.0.1:51678  127.0.0.1:12347  ino:143323 sk:ffff88003a8cdf80 ---
ESTAB 0 0  127.0.0.1:46911  127.0.0.1:12348  ino:143324 sk:ffff88003b7f05c0 <->

for SHUT_RD, SHUT_WR, SHUT_RDWR and non-shutdown sockets respectively.

The respective nlattrs in *_diag messages has appeared in Linux v3.7 and
are already present in ss's headers.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
12 years agoss: allow to retrieve AF_PACKET info via netlink
Nicolas Dichtel [Fri, 17 May 2013 15:42:34 +0000 (08:42 -0700)] 
ss: allow to retrieve AF_PACKET info via netlink

This patch add support of netlink messages for AF_PACKET and thus it allows
to get filter information of this kind of sockets.
To dump these filters info the option --bfp must be specified and the user
must have admin rights.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
12 years agoipnetconf: by default dump all entries
Nicolas Dichtel [Fri, 17 May 2013 08:47:33 +0000 (01:47 -0700)] 
ipnetconf: by default dump all entries

This is now possible, because the dump function has been added in kernel.
Note that IPv4 and IPv6 entries are displayed.

Before this patch, only all entries were displayed.

Example:
$ ip netconf
ipv4 dev lo forwarding on rp_filter off mc_forwarding 0
ipv4 dev eth0 forwarding on rp_filter off mc_forwarding 1
ipv4 all forwarding on rp_filter off mc_forwarding 1
ipv4 default forwarding on rp_filter off mc_forwarding 0
ipv6 dev lo forwarding on mc_forwarding 0
ipv6 dev eth0 forwarding on mc_forwarding 0
ipv6 all forwarding on mc_forwarding 0
ipv6 default forwarding on mc_forwarding 0

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
12 years agoip/xfrm: all to set flag XFRM_SA_XFLAG_DONT_ENCAP_DSCP
Nicolas Dichtel [Fri, 17 May 2013 08:36:38 +0000 (01:36 -0700)] 
ip/xfrm: all to set flag XFRM_SA_XFLAG_DONT_ENCAP_DSCP

For the display part, we print extra-flags only if show_stats is set, like for
standard flags.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
12 years agoadd BPF header files
Stephen Hemminger [Fri, 17 May 2013 15:36:52 +0000 (08:36 -0700)] 
add BPF header files

For later ss change.

12 years agovxlan: nag user to set port value
Stephen Hemminger [Wed, 15 May 2013 20:41:49 +0000 (13:41 -0700)] 
vxlan: nag user to set port value

This change shifts burden onto the users to choose the UDP port value.
Kernel default value is incorrect UDP port 5287 but now there is
an official assigned port for VXLAN.

The kernel can't change because of legacy compatibility
but new deployments should not use the legacy port value.

12 years agoiproute2: support NTF_ROUTER flag in VXLAN fdb entries
David L Stevens [Mon, 6 May 2013 12:11:46 +0000 (05:11 -0700)] 
iproute2: support NTF_ROUTER flag in VXLAN fdb entries

This patch allows setting the "NTF_ROUTER" flag in VXLAN forwarding table
entries to enable L3 switching for router destinations while still allowing
L2 redirection appliances for non-router MAC destinations.

Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
12 years agoss: add fastopen support
Eric Dumazet [Sat, 4 May 2013 03:48:00 +0000 (20:48 -0700)] 
ss: add fastopen support

ss -i can output "fastopen" attribute if socket used Fast Open

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
12 years agoiproute2: generalize VXLAN forwarding tables
David Stevens [Wed, 1 May 2013 03:21:22 +0000 (03:21 +0000)] 
iproute2: generalize VXLAN forwarding tables

iproute2 patch to generalize VXLAN forwarding tables

This is the iproute2 support allowing an administrator to specify alternate
ports, vnis and outgoing interfaces for VXLAN device forwarding tables.

Changes since v3: changed NDA_PORT to be 16-bit network byte order to match
changed byte-order/size in the VXLAN driver.

Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
12 years agoAdd vxlan destination port option
Stephen Hemminger [Fri, 3 May 2013 20:18:45 +0000 (13:18 -0700)] 
Add vxlan destination port option

Add ability to set UDP destination port on a per device basis.
If no port is assigned, the default IANA assigned port will be used.
If you want the kernel default value, then use port 0.

Source port range option is now called 'srcport', to avoid
confusion. The old option syntax is accepted for compatiablity.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
12 years agoip: ipv6: add tokenized interface identifier support
Daniel Borkmann [Tue, 30 Apr 2013 06:22:50 +0000 (06:22 +0000)] 
ip: ipv6: add tokenized interface identifier support

This patch adds support for tokenized IIDs, that enable
administrators to assign well-known host-part addresses
to nodes whilst still obtaining global network prefix
from Router Advertisements. This is the iproute2 part for
the kernel patch f53adae4eae5 (``net: ipv6: add tokenized
interface identifier support'').

Example commands with iproute2:

Setting a device token:
  # ip token set ::1a:2b:3c:4d/64 dev eth1

Getting a device token:
  # ip token get dev eth1
  token ::1a:2b:3c:4d dev eth1

Listing all tokens:
  # ip token list  (or: ip token)
  token :: dev eth0
  token ::1a:2b:3c:4d dev eth1

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
12 years agoUpdate headers to 3.10
Stephen Hemminger [Fri, 3 May 2013 20:15:36 +0000 (13:15 -0700)] 
Update headers to 3.10

Merge in kernel sanitized headers from upstream

12 years agoip: add missing help about mode argument
Nicolas Dichtel [Fri, 3 May 2013 15:18:41 +0000 (08:18 -0700)] 
ip: add missing help about mode argument

There is three possibilities: only IPv6, only IPv4 or both.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
12 years agoiproute2 patch against GCC 4.8.0
Kamil Rytarowski [Fri, 3 May 2013 06:52:21 +0000 (06:52 +0000)] 
iproute2 patch against GCC 4.8.0

Hello!

I'm attaching a patch [1] "Feed GCC 4.8.0 against new warning that is
shipped with -Wall: -Wsizeof-pointer-memaccess.".

More details: http://gcc.gnu.org/gcc-4.8/porting_to.html

Regards,

[1] 0001-Feed-GCC-4.8.0-against-new-warning-that-is-shipped-w.patch

>From 1f3ea01fe2ff61cbbca6474f7d9903a0756a4f44 Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski <n54@gmx.com>
Date: Fri, 3 May 2013 18:43:38 +0200
Subject: [PATCH] Feed GCC 4.8.0 against new warning that is shipped with
 -Wall: -Wsizeof-pointer-memaccess.

12 years agoiproute2: act_ipt fix xtables breakage on older versions.
Alexander Duyck [Mon, 29 Apr 2013 05:50:13 +0000 (05:50 +0000)] 
iproute2: act_ipt fix xtables breakage on older versions.

In trying to build on a RHEL6.3 I ran into several build issues that are
addressed in this patch.

The first is that xtables_merge_options only has 3 parameters.  It appears
this is how this code was originally.  As such for the case where the version
is less than 6 I am assuming it would be correct to maintain the original
setup that only had 3 parameters being passed instead of 4.

I also ran into an issue with the define for __ALIGN_KERNEL not being present.
I believe this may be due to the fact that __ALIGN_KERNEL was moved into a
separate header from ALIGN after the UAPI changes.  In order to just cover all
of the bases I have moved the main definition for the macros into
__ALIGN_KERNEL_MASK and __ALIGN_KERNEL and if ALIGN is also needed then it is
just a direct redefine to __ALIGN_KERNEL.

Cc: Hasan Chowdhury <shemonc@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
12 years agov3.9.0 v3.9.0
Stephen Hemminger [Tue, 30 Apr 2013 14:47:54 +0000 (07:47 -0700)] 
v3.9.0