1. 03 6月, 2016 1 次提交
  2. 01 6月, 2016 1 次提交
    • A
      fou: fix IPv6 Kconfig options · 95e4daa8
      Arnd Bergmann 提交于
      The Kconfig options I added to work around broken compilation ended
      up screwing up things more, as I used the wrong symbol to control
      compilation of the file, resulting in IPv6 fou support to never be built
      into the kernel.
      
      Changing CONFIG_NET_FOU_IPV6_TUNNELS to CONFIG_IPV6_FOU fixes that
      problem, I had renamed the symbol in one location but not the other,
      and as the file is never being used by other kernel code, this did not
      lead to a build failure that I would have caught.
      
      After that fix, another issue with the same patch becomes obvious, as we
      'select INET6_TUNNEL', which is related to IPV6_TUNNEL, but not the same,
      and this can still cause the original build failure when IPV6_TUNNEL is
      not built-in but IPV6_FOU is. The fix is equally trivial, we just need
      to select the right symbol.
      
      I have successfully build 350 randconfig kernels with this patch
      and verified that the driver is now being built.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reported-by: NValentin Rothberg <valentinrothberg@gmail.com>
      Fixes: fabb13db ("fou: add Kconfig options for IPv6 support")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      95e4daa8
  3. 30 5月, 2016 2 次提交
    • P
      netfilter: nf_dup_ipv6: set again FLOWI_FLAG_KNOWN_NH at flowi6_flags · 83170f3b
      Paolo Abeni 提交于
      With the commit 48e8aa6e ("ipv6: Set FLOWI_FLAG_KNOWN_NH at
      flowi6_flags") ip6_pol_route() callers were asked to to set the
      FLOWI_FLAG_KNOWN_NH properly and xt_TEE was updated accordingly,
      but with the later refactor in commit bbde9fc1 ("netfilter:
      factor out packet duplication for IPv4/IPv6") the flowi6_flags
      update was lost.
      This commit re-add it just before the routing decision.
      
      Fixes: bbde9fc1 ("netfilter: factor out packet duplication for IPv4/IPv6")
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      83170f3b
    • A
      fou: add Kconfig options for IPv6 support · fabb13db
      Arnd Bergmann 提交于
      A previous patch added the fou6.ko module, but that failed to link
      in a couple of configurations:
      
      net/built-in.o: In function `ip6_tnl_encap_add_fou_ops':
      net/ipv6/fou6.c:88: undefined reference to `ip6_tnl_encap_add_ops'
      net/ipv6/fou6.c:94: undefined reference to `ip6_tnl_encap_add_ops'
      net/ipv6/fou6.c:97: undefined reference to `ip6_tnl_encap_del_ops'
      net/built-in.o: In function `ip6_tnl_encap_del_fou_ops':
      net/ipv6/fou6.c:106: undefined reference to `ip6_tnl_encap_del_ops'
      net/ipv6/fou6.c:107: undefined reference to `ip6_tnl_encap_del_ops'
      
      If CONFIG_IPV6=m, ip6_tnl_encap_add_ops/ip6_tnl_encap_del_ops
      are in a module, but fou6.c can still be built-in, and that
      obviously fails to link.
      
      Also, if CONFIG_IPV6=y, but CONFIG_IPV6_TUNNEL=m or
      CONFIG_IPV6_TUNNEL=n, the same problem happens for a different
      reason.
      
      This adds two new silent Kconfig symbols to work around both
      problems:
      
      - CONFIG_IPV6_FOU is now always set to 'm' if either CONFIG_NET_FOU=m
        or CONFIG_IPV6=m
      - CONFIG_IPV6_FOU_TUNNEL is set implicitly when IPV6_FOU is enabled
        and NET_FOU_IP_TUNNELS is also turned out, and it will ensure
        that CONFIG_IPV6_TUNNEL is also available.
      
      The options could be made user-visible as well, to give additional
      room for configuration, but it seems easier not to bother users
      with more choice here.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: aa3463d6 ("fou: Add encap ops for IPv6 tunnels")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fabb13db
  4. 25 5月, 2016 2 次提交
  5. 21 5月, 2016 14 次提交
  6. 17 5月, 2016 2 次提交
  7. 15 5月, 2016 1 次提交
    • P
      net/route: enforce hoplimit max value · 626abd59
      Paolo Abeni 提交于
      Currently, when creating or updating a route, no check is performed
      in both ipv4 and ipv6 code to the hoplimit value.
      
      The caller can i.e. set hoplimit to 256, and when such route will
       be used, packets will be sent with hoplimit/ttl equal to 0.
      
      This commit adds checks for the RTAX_HOPLIMIT value, in both ipv4
      ipv6 route code, substituting any value greater than 255 with 255.
      
      This is consistent with what is currently done for ADVMSS and MTU
      in the ipv4 code.
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      626abd59
  8. 13 5月, 2016 3 次提交
    • A
      udp: Resolve NULL pointer dereference over flow-based vxlan device · ed7cbbce
      Alexander Duyck 提交于
      While testing an OpenStack configuration using VXLANs I saw the following
      call trace:
      
       RIP: 0010:[<ffffffff815fad49>] udp4_lib_lookup_skb+0x49/0x80
       RSP: 0018:ffff88103867bc50  EFLAGS: 00010286
       RAX: ffff88103269bf00 RBX: ffff88103269bf00 RCX: 00000000ffffffff
       RDX: 0000000000004300 RSI: 0000000000000000 RDI: ffff880f2932e780
       RBP: ffff88103867bc60 R08: 0000000000000000 R09: 000000009001a8c0
       R10: 0000000000004400 R11: ffffffff81333a58 R12: ffff880f2932e794
       R13: 0000000000000014 R14: 0000000000000014 R15: ffffe8efbfd89ca0
       FS:  0000000000000000(0000) GS:ffff88103fd80000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000000000488 CR3: 0000000001c06000 CR4: 00000000001426e0
       Stack:
        ffffffff81576515 ffffffff815733c0 ffff88103867bc98 ffffffff815fcc17
        ffff88103269bf00 ffffe8efbfd89ca0 0000000000000014 0000000000000080
        ffffe8efbfd89ca0 ffff88103867bcc8 ffffffff815fcf8b ffff880f2932e794
       Call Trace:
        [<ffffffff81576515>] ? skb_checksum+0x35/0x50
        [<ffffffff815733c0>] ? skb_push+0x40/0x40
        [<ffffffff815fcc17>] udp_gro_receive+0x57/0x130
        [<ffffffff815fcf8b>] udp4_gro_receive+0x10b/0x2c0
        [<ffffffff81605863>] inet_gro_receive+0x1d3/0x270
        [<ffffffff81589e59>] dev_gro_receive+0x269/0x3b0
        [<ffffffff8158a1b8>] napi_gro_receive+0x38/0x120
        [<ffffffffa0871297>] gro_cell_poll+0x57/0x80 [vxlan]
        [<ffffffff815899d0>] net_rx_action+0x160/0x380
        [<ffffffff816965c7>] __do_softirq+0xd7/0x2c5
        [<ffffffff8107d969>] run_ksoftirqd+0x29/0x50
        [<ffffffff8109a50f>] smpboot_thread_fn+0x10f/0x160
        [<ffffffff8109a400>] ? sort_range+0x30/0x30
        [<ffffffff81096da8>] kthread+0xd8/0xf0
        [<ffffffff81693c82>] ret_from_fork+0x22/0x40
        [<ffffffff81096cd0>] ? kthread_park+0x60/0x60
      
      The following trace is seen when receiving a DHCP request over a flow-based
      VXLAN tunnel.  I believe this is caused by the metadata dst having a NULL
      dev value and as a result dev_net(dev) is causing a NULL pointer dereference.
      
      To resolve this I am replacing the check for skb_dst(skb)->dev with just
      skb->dev.  This makes sense as the callers of this function are usually in
      the receive path and as such skb->dev should always be populated.  In
      addition other functions in the area where these are called are already
      using dev_net(skb->dev) to determine the namespace the UDP packet belongs
      in.
      
      Fixes: 63058308 ("udp: Add udp6_lib_lookup_skb and udp4_lib_lookup_skb")
      Signed-off-by: NAlexander Duyck <aduyck@mirantis.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed7cbbce
    • H
      gre: Fix wrong tpi->proto in WCCP · da73b4e9
      Haishuang Yan 提交于
      When dealing with WCCP in gre6 tunnel, it sets the wrong tpi->protocol,
      that is, ETH_P_IP instead of ETH_P_IPV6 for the encapuslated traffic.
      Signed-off-by: NHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da73b4e9
    • H
      ip6_gre: Fix get_size calculation for gre6 tunnel · 23f72215
      Haishuang Yan 提交于
      Do not include attribute IFLA_GRE_TOS.
      Signed-off-by: NHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23f72215
  9. 12 5月, 2016 2 次提交
    • D
      net: l3mdev: Add hook in ip and ipv6 · 74b20582
      David Ahern 提交于
      Currently the VRF driver uses the rx_handler to switch the skb device
      to the VRF device. Switching the dev prior to the ip / ipv6 layer
      means the VRF driver has to duplicate IP/IPv6 processing which adds
      overhead and makes features such as retaining the ingress device index
      more complicated than necessary.
      
      This patch moves the hook to the L3 layer just after the first NF_HOOK
      for PRE_ROUTING. This location makes exposing the original ingress device
      trivial (next patch) and allows adding other NF_HOOKs to the VRF driver
      in the future.
      
      dev_queue_xmit_nit is exported so that the VRF driver can cycle the skb
      with the switched device through the packet taps to maintain current
      behavior (tcpdump can be used on either the vrf device or the enslaved
      devices).
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      74b20582
    • N
      ipv6: fix 4in6 tunnel receive path · ca4aa976
      Nicolas Dichtel 提交于
      Protocol for 4in6 tunnel is IPPROTO_IPIP. This was wrongly changed by
      the last cleanup.
      
      CC: Tom Herbert <tom@herbertland.com>
      Fixes: 0d3c703a ("ipv6: Cleanup IPv6 tunnel receive path")
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ca4aa976
  10. 11 5月, 2016 1 次提交
  11. 10 5月, 2016 6 次提交
  12. 07 5月, 2016 2 次提交
  13. 05 5月, 2016 3 次提交
    • P
      netfilter: x_tables: get rid of old and inconsistent debugging · d7cdf816
      Pablo Neira Ayuso 提交于
      The dprintf() and duprintf() functions are enabled at compile time,
      these days we have better runtime debugging through pr_debug() and
      static keys.
      
      On top of this, this debugging is so old that I don't expect anyone
      using this anymore, so let's get rid of this.
      
      IP_NF_ASSERT() is still left in place, although this needs that
      NETFILTER_DEBUG is enabled, I think these assertions provide useful
      context information when reading the code.
      
      Note that ARP_NF_ASSERT() has been removed as there is no user of
      this.
      
      Kill also DEBUG_ALLOW_ALL and a couple of pr_error() and pr_debug()
      spots that are inconsistently placed in the code.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      d7cdf816
    • A
      gre6: add Kconfig dependency for NET_IPGRE_DEMUX · 8bf42e9e
      Arnd Bergmann 提交于
      The ipv6 gre implementation was cleaned up to share more code
      with the ipv4 version, but it can be enabled even when NET_IPGRE_DEMUX
      is disabled, resulting in a link error:
      
      net/built-in.o: In function `gre_rcv':
      :(.text+0x17f5d0): undefined reference to `gre_parse_header'
      ERROR: "gre_parse_header" [net/ipv6/ip6_gre.ko] undefined!
      
      This adds a Kconfig dependency to prevent that now invalid
      configuration.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 308edfdf ("gre6: Cleanup GREv6 receive path, call common GRE functions")
      Acked-by: NTom Herbert <tom@herbertland.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8bf42e9e
    • J
      gre: change gre_parse_header to return the header length · f132ae7c
      Jiri Benc 提交于
      It's easier for gre_parse_header to return the header length instead of
      filing it into a parameter. That way, the callers that don't care about the
      header length can just check whether the returned value is lower than zero.
      
      In gre_err, the tunnel header must not be pulled. See commit b7f8fe25
      ("gre: do not pull header in ICMP error processing") for details.
      
      This patch reduces the conflict between the mentioned commit and commit
      95f5c64c ("gre: Move utility functions to common headers").
      Signed-off-by: NJiri Benc <jbenc@redhat.com>
      Acked-by: NTom Herbert <tom@herbertland.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f132ae7c