- 18 Jan, 2016 1 commit
-
-
Stephen Hemminger authored
This reverts commit 8f80d450.
-
- 11 Jan, 2016 5 commits
-
-
Stephen Hemminger authored
-
Stephen Hemminger authored
This reverts commit d4585a4b. This commit is meant for later kernel.
-
Jamal Hadi Salim authored
since all tc classifiers are required to specify ethertype as part of grammar By not allowing eth_type to be specified we remove contradiction for example when a user specifies: tc filter add ... priority xxx protocol ip flower eth_type ipv6 This patch removes that contradiction Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
-
Julien Floret authored
gcc < 4.6 does not handle C11 syntax for the static initialization of anonymous struct/union, hence the following error: tc_bpf.c:260: error: unknown field map_type specified in initializer Signed-off-by: Julien Floret <julien.floret@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
-
Roopa Prabhu authored
This patch replaces exits with returns in iplink command. Helps to continue on errors when invoked with ip -force -batch. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
-
- 07 Jan, 2016 1 commit
-
-
Phil Sutter authored
When specifying a conntrack zone, the 'zone' keyword has to be used before the actual zone index. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
- 06 Jan, 2016 3 commits
-
-
Stephen Hemminger authored
The FQ man page was not following whatis formatting rules.
-
Richard Alpe authored
This enables a user to remove an offline peer from the kernel data structures. This could for example be useful when deliberately scaling in peer nodes in a cloud environment. Signed-off-by: Richard Alpe <richard.alpe@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com>
-
Richard Alpe authored
-
- 22 Dec, 2015 1 commit
-
-
Phil Sutter authored
I repeatedly failed to get this right, so now I have to clean up my mess afterwards. Fixes: 7d6aadcd ("ip{,6}tunnel: have a shared stats parser/printer") Signed-off-by: Phil Sutter <phil@nwl.cc>
-
- 18 Dec, 2015 9 commits
-
-
Phil Sutter authored
This has a slight side-effect of not aborting when /proc/net/dev is malformed, but OTOH stats are not parsed for uninteresting interfaces. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Paolo Abeni authored
Currently ip6 encap support for lwtunnel is missing. This patch implement it, mostly duplicating the ipv4 parts. Also be sure to insert a space after the encap type, when showing lwtunnel, to avoid the tunnel type and the following argument being merged into a single word. Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-
Paolo Abeni authored
This patch add support for IFLA_GRE_COLLECT_METADATA via the 'external' keyword to the gre link. Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-
Paolo Abeni authored
This patch add support for IFLA_VXLAN_COLLECT_METADATA via the 'external' keyword to the vxlan link. Also enforce mutual exclusion between 'vni' and 'external'. Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-
Hannes Frederic Sowa authored
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
-
Paolo Abeni authored
Currently parse_encap_ip() does not update correctly argv/argc; if multiple lwtunnel arguments are provided, the parsing fails after the first one, i.e. ip route add 172.16.101.0/24 dev vxlan1 encap ip id 42 dst 192.168.255.1 fails with: Error: either "to" is duplicate, or "dst" is a garbage. This commit addresses the issue, stepping to next argument at each iteration of the parsing loop. Fixes: 1e529305 ("lwtunnel: Add encapsulation support to ip route") Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-
Phil Sutter authored
Commit 0f754332 ("route: ignore RTAX_HOPLIMIT of value -1") accidentally reordered fprintf statements. This patch restores the original ordering. Fixes: 0f754332 ("route: ignore RTAX_HOPLIMIT of value -1") Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Konstantin Khlebnikov authored
Though dumping such entries crashes present kernels. Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
-
Tom Herbert authored
This patch: - Adds a utility function for parsing a 64 bit address - Adds a utility function for converting a 64 bit address to ASCII - Adds and ILA encap type in lwt tunnels Signed-off-by: Tom Herbert <tom@herbertland.com>
-
- 10 Dec, 2015 5 commits
-
-
Stephen Hemminger authored
The tunnel code was doing sscanf(buf, "%ld", &x) where x was unsigned long.
-
Phil Sutter authored
Just a typo there, it's spelled correctly in SEE ALSO section.. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
David Ahern authored
Currently, the table id for VRF devices requires an integer. Convert it to use rtnl_rttable_a2n which handles table names from the iproute2 directory. This also fixes a bug in the original commit where table name are not properly handled. Fixes: 15faa0a3 ("add support for VRF device") Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
-
Nicolas Dichtel authored
There is two variables named 'len' in rtnl_talk. In fact, commit c079e121 didn't work. For example, it was possible to trigger a seg fault with this command: $ ip link set gre2 type ip6gre hoplimit 32 Let's rename the argument len to maxlen. Fixes: c079e121 ("libnetlink: add size argument to rtnl_talk") Reported-by: Thomas Faivre <thomas.faivre@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
-
Phil Sutter authored
Older kernels use -1 internally as indicator to use the sysctl default, but they still export the setting. Newer kernels use 0 to indicate that (which is why the conversion from -1 to 0 was done here), but they also stopped exporting the value. Since the meaning of -1 is clear, treat it equally like default on newer kernels (which is to not print anything). Signed-off-by: Phil Sutter <phil@nwl.cc>
-
- 29 Nov, 2015 15 commits
-
-
Stephen Hemminger authored
Make iptunnel pass checkpatch (mostly).
-
Konstantin Shemyak authored
On 24.11.2015 02:26, Stephen Hemminger wrote: > On Thu, 12 Nov 2015 21:10:08 +0000 > Konstantin Shemyak <konstantin@shemyak.com> wrote: > >> When creating an IP tunnel over IPv6, the address family must be passed in >> the option, e.g. >> >> ip -6 tunnel add mode ip6gre local 1::1 remote 2::2 >> >> This makes it impossible to create both IPv4 and IPv6 tunnels in one batch. >> >> In fact the address family option is redundant here, as each tunnel mode is >> relevant for only one address family. >> The patch determines whether the applicable address family is AF_INET6 >> instead of the default AF_INET and makes the "-6" option unnecessary for >> "ip tunnel add". >> >> Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com> >> --- >> ip/iptunnel.c | 26 ++++++++++++++++++++++++++ >> testsuite/tests/ip/tunnel/add_tunnel.t | 14 ++++++++++++++ >> 2 files changed, 40 insertions(+) >> create mode 100755 testsuite/tests/ip/tunnel/add_tunnel.t >> >> diff --git a/ip/iptunnel.c b/ip/iptunnel.c >> index 78fa988..7826a37 100644 >> --- a/ip/iptunnel.c >> +++ b/ip/iptunnel.c >> @@ -629,8 +629,34 @@ static int do_6rd(int argc, char **argv) >> return tnl_6rd_ioctl(cmd, medium, &ip6rd); >> } >> >> +static int tunnel_mode_is_ipv6(char *tunnel_mode) { >> + char *ipv6_modes[] = { >> + "ipv6/ipv6", "ip6ip6", >> + "vti6", >> + "ip/ipv6", "ipv4/ipv6", "ipip6", "ip4ip6", >> + "ip6gre", "gre/ipv6", >> + "any/ipv6", "any" >> + }; >> + int i; >> + >> + for (i = 0; i < sizeof(ipv6_modes) / sizeof(char *); i++) { >> + if (strcmp(ipv6_modes[i], tunnel_mode) == 0) >> + return 1; >> + } >> + return 0; >> +} >> + > > The ipv6_modes table should be static const. Thank you for the note! attached the corrected patch. > Also is it possible to use strstr for ipv6 and ip6 or even strchr(tunnel_mode, '6') > to simplify this? There is IPv6 tunnel mode 'any', and IPv4 tunnel mode 'ipv6/ip' (aka 'sit'). It looks to me that attempts to find some substring match would not make the code much shorter, but definitely less readable. Konstantin Shemyak. >From 42d27db0055c3a114fe6eb86d680bef9ec098ad4 Mon Sep 17 00:00:00 2001 From: Konstantin Shemyak <konstantin@shemyak.com> Date: Thu, 12 Nov 2015 20:52:02 +0200 Subject: [PATCH] Tunnel address family is determined from the tunnel mode When the tunnel mode already tells the IP address family, "ip tunnel" command determines it and does not require option "-4"/"-6" to be passed. This makes possible creating both IPv4 and IPv6 tunnels in one batch. Signed-off-by: Konstantin Shemyak <konstantin@shemyak.com>
-
Tom Herbert authored
This patch adds support to remote checksum checksum offload to VXLAN. This patch adds remcsumtx and remcsumrx to ip vxlan configuration to enable remote checksum offload for transmit and receive on the VXLAN tunnel. https://tools.ietf.org/html/draft-herbert-vxlan-rco-00 Example: ip link add name vxlan0 type vxlan id 42 group 239.1.1.1 dev eth0 \ udpcsum remcsumtx remcsumrx Testing: Ran single netperf over mlnx4 to illustrate the effest: - Without RCO (UDP csum set to zero) 4335.99 Mbps - With RCO enabled 7661.81 Mbps Signed-off-by: Tom Herbert <tom@herbertland.com>
-
Phil Sutter authored
fgets() will read at most size-1 bytes into the buffer and add a terminating null-char at the end. Therefore it is not necessary to pass a reduced buffer size when calling it. This change was generated using the following semantic patch: @@ identifier buf, fp; @@ - fgets(buf, sizeof(buf) - 1, fp) + fgets(buf, sizeof(buf), fp) Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Although not fundamentally necessary to check return codes in these spots, preventing the warnings will put new ones into focus. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
No need to keep static port boundaries global, they are not used directly. Keeping them local also allows to safely reduce their names to the minimum. Assign hardcoded fallback values also if fscanf() fails. Get rid of unnecessary braces around return parameter. Instead of more or less duplicating is_ephemeral() in run_ssfilter(), simply call the function instead. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Exit early or continue on error instead of putting conditional into conditional to make reading the code a bit easier. Also, the call to memcpy() can be skipped by initialising prog with the desired prefix. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Instead of calling rewind() and fgets() before every call to scan_lines(), move them into scan_lines() itself. This should also fix compat mode, as before the second call to scan_lines() the first line was skipped unconditionally. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
- Replace commas at end of subsection with dots. - Replace double whitespace by single one. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Technically, the range of possible hoplimit values are defined by IPv4 and IPv6 header formats. Both define the field to be eight bits in size, which leads to a value range of [0;255]. Setting a packet's hoplimit field to 0 though makes not much sense, as the next hop would immediately drop the packet. Therefore Linux uses 0 as a special value indicating to use the system's default hoplimit (configurable via sysctl). In iproute, setting the hoplimit of a route to 0 is equivalent to omitting the hoplimit parameter alltogether, so it is actually not necessary to allow that value to be specified, but keep it anyway for backwards compatibility. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Since it uses only a single filter, rtnl_dump_filter() can be used. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Right after ipaddr_reset_filter(), filter.family is always AF_UNSPEC. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Linux version 3.1 introduced a consistency check for netlink dumps in commit 670dc28 ("netlink: advertise incomplete dumps"). This bites iproute2 when flushing more addresses than can fit into a single RTM_GETADDR response. To silence the spurious error message "Dump was interrupted and may be inconsistent.", advise rtnl_dump_filter_l() to not care about NLM_F_DUMP_INTR. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Allow for a filter to ignore certain nlmsg_flags. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Since it's no longer relevant whether an IP address is primary or secondary when flushing, ipaddr_flush() can be simplified a bit. Signed-off-by: Phil Sutter <phil@nwl.cc>
-