1. 11 Jan, 2016 5 commits
  2. 07 Jan, 2016 1 commit
  3. 06 Jan, 2016 3 commits
  4. 22 Dec, 2015 1 commit
  5. 18 Dec, 2015 9 commits
  6. 10 Dec, 2015 5 commits
  7. 29 Nov, 2015 16 commits
    • Stephen Hemminger's avatar
      iptunnel: cleanup code · a96a5d94
      Stephen Hemminger authored
      Make iptunnel pass checkpatch (mostly).
      a96a5d94
    • Konstantin Shemyak's avatar
      ip_tunnel: determine tunnel address family from the tunnel type · cc9c1dfa
      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: default avatarKonstantin Shemyak <konstantin@shemyak.com>
      cc9c1dfa
    • Tom Herbert's avatar
      vxlan: Add support for remote checksum offload · 35f59d86
      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: default avatarTom Herbert <tom@herbertland.com>
      35f59d86
    • Phil Sutter's avatar
      get rid of unnecessary fgets() buffer size limitation · 61170fd8
      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: default avatarPhil Sutter <phil@nwl.cc>
      61170fd8
    • Phil Sutter's avatar
      get rid of remaining -Wunused-result warnings · d572ed4d
      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: default avatarPhil Sutter <phil@nwl.cc>
      d572ed4d
    • Phil Sutter's avatar
      ss: review is_ephemeral() · c29d3792
      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: default avatarPhil Sutter <phil@nwl.cc>
      c29d3792
    • Phil Sutter's avatar
      ss: reduce max indentation level in init_service_resolver() · 596307ea
      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: default avatarPhil Sutter <phil@nwl.cc>
      596307ea
    • Phil Sutter's avatar
      lnstat: review lnstat_update() · db3ef44c
      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: default avatarPhil Sutter <phil@nwl.cc>
      db3ef44c
    • Phil Sutter's avatar
      bridge.8: minor formatting cleanup · fc31817d
      Phil Sutter authored
      - Replace commas at end of subsection with dots.
      - Replace double whitespace by single one.
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      fc31817d
    • Phil Sutter's avatar
      iproute: restrict hoplimit values to be in range [0; 255] · ea6cbab7
      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: default avatarPhil Sutter <phil@nwl.cc>
      ea6cbab7
    • Phil Sutter's avatar
      iptoken: simplify iptoken_list a bit · d81f54d5
      Phil Sutter authored
      Since it uses only a single filter, rtnl_dump_filter() can be used.
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      d81f54d5
    • Phil Sutter's avatar
      ipaddress: drop unnecessary check in ipaddr_list_flush_or_save() · 906dfe48
      Phil Sutter authored
      Right after ipaddr_reset_filter(), filter.family is always AF_UNSPEC.
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      906dfe48
    • Phil Sutter's avatar
      ipaddress: fix ipaddr_flush for Linux >= 3.1 · d25ec03e
      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: default avatarPhil Sutter <phil@nwl.cc>
      d25ec03e
    • Phil Sutter's avatar
      libnetlink: introduce nc_flags · 8e72880f
      Phil Sutter authored
      Allow for a filter to ignore certain nlmsg_flags.
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      8e72880f
    • Phil Sutter's avatar
      ipaddress: simplify ipaddr_flush() · c6995c48
      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: default avatarPhil Sutter <phil@nwl.cc>
      c6995c48
    • Stephen Hemminger's avatar
      rt_names: style cleanup · 68ef5072
      Stephen Hemminger authored
      Cleanup all checkpatch complaints about whitespace in rt_names.
      68ef5072