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

10 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

10 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.

10 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.

10 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.

10 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>
10 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>
10 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>
10 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>
10 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.

11 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>
11 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>
11 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.

11 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>
11 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>
11 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

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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.

11 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>
11 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>
11 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>
11 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.

11 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>
11 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>
11 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>
11 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>
11 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.

11 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.

11 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>
11 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>
11 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>
11 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>
11 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>
11 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

11 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>
11 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.

11 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>
11 years agov3.9.0
Stephen Hemminger [Tue, 30 Apr 2013 14:47:54 +0000 (07:47 -0700)]
v3.9.0

11 years agolibnetlink: Use ifinfomsg instead of rtgenmsg in rtnl_wilddump_req_filter
Alexander Duyck [Thu, 25 Apr 2013 12:07:10 +0000 (12:07 +0000)]
libnetlink: Use ifinfomsg instead of rtgenmsg in rtnl_wilddump_req_filter

This change corrects a kernel incompatibility that was resulting in the
ext_filter_mask not being correctly discovered by the kernel as it is buried
somewhere in the ifinfomsg.

Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
11 years agoipnetns: fix build on older systems
Stephen Hemminger [Wed, 17 Apr 2013 20:33:26 +0000 (13:33 -0700)]
ipnetns: fix build on older systems

Debian Squeeze has out of date <sys/mount.h> without the required flags.

11 years agoRevert "add linux/fs.h"
Stephen Hemminger [Wed, 17 Apr 2013 20:30:17 +0000 (13:30 -0700)]
Revert "add linux/fs.h"

This reverts commit 5abe4685b6aad913535116dd256a9e3f465ae0f1.

11 years agoadd linux/fs.h
Stephen Hemminger [Wed, 17 Apr 2013 20:26:47 +0000 (13:26 -0700)]
add linux/fs.h

The ipnetns nees MS_SLAVE, MS_SHARED etc definitions which
are in include/linux/fs.h.

11 years agoutils: fix range checking for get_u32/get_u64 et all
Stephen Hemminger [Fri, 12 Apr 2013 18:40:57 +0000 (11:40 -0700)]
utils: fix range checking for get_u32/get_u64 et all

Be more careful about overflow in strtoXX routines.
Checks are based on documented interface on man pages.
Based on suggestion from "Mr Dash Four".

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
11 years agoadd short description of batch mode in tc man page
Hubert Kario [Thu, 11 Apr 2013 04:49:50 +0000 (04:49 +0000)]
add short description of batch mode in tc man page

The tc command is missing documentation of -batch and -force switches
that are returned by "tc -help".
Add short description on their syntax and usage.

11 years agoiproute2: Fix some manpage typos
Petr Sabata [Thu, 4 Apr 2013 03:36:57 +0000 (03:36 +0000)]
iproute2: Fix some manpage typos

This patch fixes some of the typos found in iproute2
documentation.

Signed-off-by: Petr Šabata <contyk@redhat.com>
11 years agoUpdate kernel headers to 3.9-rc5
Stephen Hemminger [Mon, 1 Apr 2013 18:56:36 +0000 (11:56 -0700)]
Update kernel headers to 3.9-rc5

11 years agoip: remove unnecessary ll_init_map
Stephen Hemminger [Thu, 28 Mar 2013 22:17:47 +0000 (15:17 -0700)]
ip: remove unnecessary ll_init_map

Don't call ll_init_map on modify operations
Saves significant overhead with 1000's of devices.

11 years agoll_map: add name and index hash
Stephen Hemminger [Thu, 28 Mar 2013 21:57:28 +0000 (14:57 -0700)]
ll_map: add name and index hash

Make ll_ functions faster by having a name hash, and allow
for deletion. Also, allow them to work without calling ll_init_map.

11 years agolibnetlink: check flag NLM_F_DUMP_INTR during dumps
Nicolas Dichtel [Fri, 22 Mar 2013 06:34:02 +0000 (06:34 +0000)]
libnetlink: check flag NLM_F_DUMP_INTR during dumps

When this flag is set, it means that dump was interrupted and result may be
inconsistent.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
11 years agoip/xfrm: Improve error strings
David Ward [Mon, 25 Mar 2013 04:23:19 +0000 (04:23 +0000)]
ip/xfrm: Improve error strings

Quotation marks are now used only to indicate literal text on the
command line.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
11 years agoip/xfrm: Improve usage text and documentation
David Ward [Mon, 25 Mar 2013 04:23:18 +0000 (04:23 +0000)]
ip/xfrm: Improve usage text and documentation

Change ALGO-KEY to ALGO-KEYMAT to make it more obvious that the
keying material might need to contain more than just the key (such
as a salt or nonce value).

List the algorithm names that currently exist in the kernel.

Indicate that for IPComp, the Compression Parameter Index (CPI) is
used as the SPI.

Group the list of mode values by transform protocol.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
11 years agoip/xfrm: Command syntax should not expect a key for compression
David Ward [Mon, 25 Mar 2013 04:23:17 +0000 (04:23 +0000)]
ip/xfrm: Command syntax should not expect a key for compression

Compression algorithms do not use a key.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
11 years agoip/xfrm: Do not print a zero-length algorithm key
David Ward [Mon, 25 Mar 2013 04:23:16 +0000 (04:23 +0000)]
ip/xfrm: Do not print a zero-length algorithm key

Signed-off-by: David Ward <david.ward@ll.mit.edu>
11 years agoip/xfrm: Improve transform protocol-specific parameter checking
David Ward [Mon, 25 Mar 2013 04:23:15 +0000 (04:23 +0000)]
ip/xfrm: Improve transform protocol-specific parameter checking

Ensure that only algorithms and modes supported by the transform
protocol are specified (so that errors are more obvious).

Signed-off-by: David Ward <david.ward@ll.mit.edu>
11 years agoip/xfrm: Do not allow redundant algorithm combinations to be specified
David Ward [Mon, 25 Mar 2013 04:23:14 +0000 (04:23 +0000)]
ip/xfrm: Do not allow redundant algorithm combinations to be specified

AEAD algorithms perform both encryption and authentication; they are
not combined with separate encryption or authentication algorithms.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
11 years agoip/xfrm: Extend SPI validity checking
David Ward [Mon, 25 Mar 2013 04:23:13 +0000 (04:23 +0000)]
ip/xfrm: Extend SPI validity checking

A Security Policy Index (SPI) is not used with Mobile IPv6. IPComp
uses a smaller 16-bit Compression Parameter Index (CPI) which is
passed as the SPI value. Perform checks whenever specifying an ID.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
11 years agoiproute2: update ip-l2tp man page
James Chapman [Tue, 26 Mar 2013 06:49:23 +0000 (06:49 +0000)]
iproute2: update ip-l2tp man page

Add documentation about the new l2spec_type parameter for "ip l2tp add
session".

Signed-off-by: James Chapman <jchapman@katalix.com>
11 years agoiproute2: add l2spec_type param to l2tp add session
James Chapman [Tue, 26 Mar 2013 06:49:22 +0000 (06:49 +0000)]
iproute2: add l2spec_type param to l2tp add session

When unmanaged L2TP sessions are created using "ip l2tp add session",
there is no option to allow the session's Layer2SpecificHeader type to
be selected - the kernel's default setting is always used. For
interopability with some vendor equipment, it might be necessary to
use a different setting. So add a new l2spec_type parameter to the "ip
l2tp add session" parameter list, allowing operators to set a specific
Layer2SpecificHeader type. The kernel already exposes the setting as a
netlink attribute so it is straightforward to add support for it in
iproute2.

This change allows unmanaged L2TP sessions to be configured between
Linux and some Cisco equipment by specifying "l2spec_type none" in "ip
l2tp add session" command parameters.

Signed-off-by: James Chapman <jchapman@katalix.com>
11 years agoll_map: use net/if.h to get prototype
Stephen Hemminger [Wed, 27 Mar 2013 16:28:58 +0000 (09:28 -0700)]
ll_map: use net/if.h to get prototype

Better to get prototype from system headers

11 years agoll_map: remove unused address fields
Stephen Hemminger [Wed, 27 Mar 2013 16:26:25 +0000 (09:26 -0700)]
ll_map: remove unused address fields

The address was being stored but not used by current code.

11 years agotc-tbf: remove ancient references to Alpha
Stephen Hemminger [Fri, 22 Mar 2013 18:18:25 +0000 (11:18 -0700)]
tc-tbf: remove ancient references to Alpha

In older versions of traffic shaping the Alpha kernel was special
and had higher HZ. This no longer matters, TC is based on high
resoulution timers in kernel.

11 years agoip xfrm state: Allow different selector family
Thomas Egerer [Wed, 20 Mar 2013 09:18:43 +0000 (02:18 -0700)]
ip xfrm state: Allow different selector family

My previous commit introduced a patch to allow for states with different
ip address families for selector and id. The must have somehow been a
mixup of the patch I tested and the one I send, so the patch sent breaks
the iproute2 build. This patch fixes this. My apologies.

Signed-off-by: Thomas Egerer <hakke_007@gmx.de>
11 years agoip xfrm state: Allow different selector family
Thomas Egerer [Sun, 17 Mar 2013 00:56:01 +0000 (00:56 +0000)]
ip xfrm state: Allow different selector family

Do not enforce the selector of a state to have the same address family
as the id. This makes it possible to configure inter family states.

Signed-off-by: Thomas Egerer <hakke_007@gmx.de>
11 years agobridge: add oneline option
Stephen Hemminger [Sat, 16 Mar 2013 17:18:50 +0000 (10:18 -0700)]
bridge: add oneline option

Split output of 'bridge link' across multiple lines,
only show the flags if -d is set, and add --oneline option
like ip command.

11 years agoman: Add documentation for the bridge link operation.
Vlad Yasevich [Fri, 15 Mar 2013 17:05:08 +0000 (10:05 -0700)]
man: Add documentation for the bridge link operation.

Bridge tool now supports setting and retrieving bridge port specific
link attributes.  Document what attributes are supported and what
they mean.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
11 years agobridge: Add support for printing bridge port attributes
Vlad Yasevich [Fri, 15 Mar 2013 17:01:28 +0000 (10:01 -0700)]
bridge: Add support for printing bridge port attributes

Output new nested bridge port attributes.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
11 years agobridge: Add support for setting bridge port attributes
Vlad Yasevich [Fri, 15 Mar 2013 17:01:28 +0000 (10:01 -0700)]
bridge: Add support for setting bridge port attributes

Add netlink support bridge port attributes such as cost, priority, state
and flags.  This also adds support for HW mode such as VEPA or VEB.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
11 years agoipaddress: minor white space cleanup
Stephen Hemminger [Thu, 14 Mar 2013 20:47:49 +0000 (13:47 -0700)]
ipaddress: minor white space cleanup

Convert leading spaces to tabs, and put alias in one printf

11 years agoipmaddr: add whitespace around =
Stephen Hemminger [Thu, 14 Mar 2013 20:44:25 +0000 (13:44 -0700)]
ipmaddr: add whitespace around =

fix warning from parser

11 years agoiproute2: Mention the 'up' argument in documentation
Petr Šabata [Thu, 14 Mar 2013 14:10:44 +0000 (15:10 +0100)]
iproute2: Mention the 'up' argument in documentation

Both ip-link and ip-address support the 'up' argument, however this
isn't documented in neither their help outputs or ip-address' manpage.
This patch fixes that.

Signed-off-by: Petr Šabata <contyk@redhat.com>
Reported-by: Jiří Popelka <jpopelka@redhat.com>
11 years agoFix build when shared libraries are disabled
Stephen Hemminger [Wed, 13 Mar 2013 15:29:59 +0000 (08:29 -0700)]
Fix build when shared libraries are disabled

On some platforms, shared libraries are not used. The stub code
need some updating to not generate errors.

11 years agoFix -oneline output when alias present
roopa [Tue, 12 Mar 2013 22:04:02 +0000 (15:04 -0700)]
Fix -oneline output when alias present

This patch removes '\n' in -oneline output when alias
present on interface

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
11 years agoiproute2: Document the -D and -I options
Eric W. Biederman [Mon, 11 Mar 2013 21:59:55 +0000 (14:59 -0700)]
iproute2: Document the -D and -I options

While looking into a sysctl regression in decnet on old kernels I
discovered this omission in the iproute2 documentation.

I can't imagine anyone's muscle memory remembering the longer forms.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
11 years agobridge: cleanup usage message
Stephen Hemminger [Wed, 6 Mar 2013 19:04:29 +0000 (11:04 -0800)]
bridge: cleanup usage message

Fdb usage message got too long.

11 years agobridge: Update bridge man pages to include vlan command
Vlad Yasevich [Thu, 28 Feb 2013 10:04:06 +0000 (10:04 +0000)]
bridge: Update bridge man pages to include vlan command

Add the vlan command documentation to bridge man page.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
11 years agobridge: Add vlan configuration support
Vlad Yasevich [Thu, 28 Feb 2013 10:04:05 +0000 (10:04 +0000)]
bridge: Add vlan configuration support

Recent kernel patches added support for VLAN filtering on the bridge.
This functionality allows one to turn a basic bridge into a VLAN bridge,
where VLANs dicatate packet forwarding and header transformation.

To configure the VLANs on the bridge and its ports a new command is
added to the 'bridge' utility.

   # bridge vlan add dev eth0 vid 10 pvid untagged brdev
   # bridge vlan add
   # bridge vlan delete dev eth0 vid 10
   # bridge vlan show

This command supports the following flags:
   master - peform the operation on the software bridge device.  This is
    the default behavior.
   self  -  perform the operation on the hardware associated with the port.
            This flag is required when the device is the bridge device and
    the configuration is desired on the bridge device itself (not
    one of the ports).
   pvid  -  Set the PVID (port vlan id) for a given port.  Any untagged
            frames arriving on the port will be assigned to this vlan.
   untagged - Sets the egress policy of for a given vlan.  Default port
            egress policy is tagged.  Set this flag if you wish traffic
            associated with this VLAN to exit the port untagged.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
11 years agobridge: Add vlan support to fdb entries
Vlad Yasevich [Thu, 28 Feb 2013 10:04:04 +0000 (10:04 +0000)]
bridge: Add vlan support to fdb entries

Provide the ability to set and show vlans on FDB entries.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
11 years agoRevert "generalize VXLAN forwarding tables"
Stephen Hemminger [Wed, 6 Mar 2013 19:02:46 +0000 (11:02 -0800)]
Revert "generalize VXLAN forwarding tables"

This reverts commit 90ad5ae77ea4d14e0e1aaa587e48fca5bfde0593.

11 years agogeneralize VXLAN forwarding tables
David Stevens [Thu, 28 Feb 2013 09:26:14 +0000 (09:26 +0000)]
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.

Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
11 years agoiplink_vlan: Add flag for Multiple VLAN Registration Protocol (MVRP)
David Ward [Wed, 27 Feb 2013 13:00:40 +0000 (13:00 +0000)]
iplink_vlan: Add flag for Multiple VLAN Registration Protocol (MVRP)

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Patrick McHardy <kaber@trash.net>
11 years agoip/iptunnel: Fix incorrect syntax in man page
David Ward [Wed, 27 Feb 2013 12:58:15 +0000 (12:58 +0000)]
ip/iptunnel: Fix incorrect syntax in man page

Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: David Ward <david.ward@ll.mit.edu>
11 years agoipntable: more fixes for ppc64
Stephen Hemminger [Mon, 4 Mar 2013 21:59:39 +0000 (13:59 -0800)]
ipntable: more fixes for ppc64

Not all arch have sizeof(unsigned long long) == sizeof(__u64)

11 years agofix dependency on sizeof(__u64) == sizeof(unsigned long long)
Stephen Hemminger [Thu, 28 Feb 2013 16:51:46 +0000 (08:51 -0800)]
fix dependency on sizeof(__u64) == sizeof(unsigned long long)

Some platforms like ppc64 have unsigned long long as 128 bits, and
the printf format string would cause errors. Resolve this by using
unsigned long long where necessary (or unsigned long).

11 years agoUpdate kernel headers to 3.9.0-rc1
Stephen Hemminger [Thu, 28 Feb 2013 16:43:46 +0000 (08:43 -0800)]
Update kernel headers to 3.9.0-rc1

11 years agoip: fix ipv6 ntable on ppc64
Stephen Hemminger [Wed, 27 Feb 2013 15:26:17 +0000 (07:26 -0800)]
ip: fix ipv6 ntable on ppc64

Add casts to handle printf format when
 sizeof(unsigned long long) != sizeof(__u64)

11 years agoFix compilation error of m_ipt.c with -Werror enabled
Vijay Subramanian [Tue, 26 Feb 2013 09:12:07 +0000 (09:12 +0000)]
Fix compilation error of m_ipt.c with -Werror enabled

Commit (5a650703d47e10aa386406c855eff5a593b2120b Makefile: make warnings into
errors ) causes the following build error.

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 -DCONFIG_GACT -DCONFIG_GACT_PROB -DIPT_LIB_DIR=\"/lib/xtables\"
-DYY_NO_INPUT   -c -o m_ipt.o m_ipt.c
cc1: warnings being treated as errors
m_ipt.c:72: error: no previous prototype for 'xtables_register_target'
m_ipt.c:361: error: no previous prototype for 'build_st'
make[1]: *** [m_ipt.o] Error 1

This is fixed by adding the prototype in the header include/iptables.h

I am not sure if this is due to something wrong on my build system but I am
using current glibc 2.17.

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
11 years agoss: show socket memory stats for unix sockets if requested
Hannes Frederic Sowa [Fri, 22 Feb 2013 15:28:18 +0000 (15:28 +0000)]
ss: show socket memory stats for unix sockets if requested

The output format is the same as for tcp sockets but only the following
fields are currently non-zero: sk_rcvbuf, sk_wmem_alloc and sk_sndbuf.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
11 years agoss: use rta_getattr_u32
Stephen Hemminger [Wed, 27 Feb 2013 01:32:58 +0000 (17:32 -0800)]
ss: use rta_getattr_u32

11 years agoss: show send queue length on unix domain sockets
Hannes Frederic Sowa [Fri, 22 Feb 2013 15:28:10 +0000 (15:28 +0000)]
ss: show send queue length on unix domain sockets

On sockets in listen state Send-Q reports the maximum backlog,
otherwise it reports allocated socket write memory.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
11 years agov3.8.0
Stephen Hemminger [Thu, 21 Feb 2013 16:41:20 +0000 (08:41 -0800)]
v3.8.0

11 years agoiproute2: clearer error messages for fifo and tbf qdiscs
Kees van Reeuwijk [Tue, 19 Feb 2013 07:46:04 +0000 (07:46 +0000)]
iproute2: clearer error messages for fifo and tbf qdiscs

Clearer error messages for fifo and tbf qdiscs:
- Say who is complaining
- Don't just say a parameter is bad, show the offending parameter
- Be clearer about duplicate parameters vs illegal pairs of parameters
- Try to give multiple error messages rather than let the user discover the errors one by one
- When there are parameter aliases, try to use the variant that was used, or at least mention them all

Note that in the old version an empty parameter list to tbf would just cause an explain() message
without a specific error message. By simply removing the relevant error check, the code now
handles this error more gracefully by printing an error message for all mandatory parameters.
It still prints the explain() message.

Signed-off-by: Kees van Reeuwijk <reeuwijk@few.vu.nl>
11 years agortnl_wilddump_request: fix alignment issue for embedded platforms
Lutz Jaenicke [Thu, 30 Aug 2012 05:01:34 +0000 (05:01 +0000)]
rtnl_wilddump_request: fix alignment issue for embedded platforms

Platforms have different alignment requirements which need to be
fulfilled by the compiler. If the structure elements are already
4 byte (NLMGS_ALIGNTO) aligned by the compiler adding an explicit
padding element (align_rta) is not allowed.
Use __attribute__ ((aligned (NLMSG_ALIGNTO))) in order to achieve
the required alignment.
Experienced on ARM (xscale) with symptom
  netlink: 12 bytes leftover after parsing attributes

Tested on:
  ARM      (32bit Big Endian)
  PowerPC  (32bit Big Endian)
  x86_64   (64bit Little Endian)
Each with different aligment requirments.

Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/shemminger...
Stephen Hemminger [Tue, 19 Feb 2013 15:19:12 +0000 (07:19 -0800)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2