02 Jun, 2020

1 commit

  • The sock_bindtoindex intended for kernel wide usage however
    it will lock the socket regardless of the context. This modification
    relax this behavior optionally: locking the socket will be optional
    by calling the sock_bindtoindex with lock_sk = true.

    The modification applied to all users of the sock_bindtoindex.

    Signed-off-by: Ferenc Fejes
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/bee6355da40d9e991b2f2d12b67d55ebb5f5b207.1590871065.git.fejes@inf.elte.hu

    Ferenc Fejes
     

29 May, 2020

2 commits


21 May, 2019

1 commit

  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have MODULE_LICENCE("GPL*") inside which was used in the initial
    scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

18 Jan, 2019

1 commit


21 Dec, 2018

1 commit


20 Dec, 2018

1 commit

  • syzbot reported the use of uninitialized udp6_addr::sin6_scope_id.
    We can just set ::sin6_scope_id to zero, as tunnels are unlikely
    to use an IPv6 address that needs a scope id and there is no
    interface to bind in this context.

    For net-next, it looks different as we have cfg->bind_ifindex there
    so we can probably call ipv6_iface_scope_id().

    Same for ::sin6_flowinfo, tunnels don't use it.

    Fixes: 8024e02879dd ("udp: Add udp_sock_create for UDP tunnels to open listener socket")
    Reported-by: syzbot+c56449ed3652e6720f30@syzkaller.appspotmail.com
    Cc: Jon Maloy
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

04 Dec, 2018

1 commit

  • UDP tunnel sockets are always opened unbound to a specific device. This
    patch allow the socket to be bound on a custom device, which
    incidentally makes UDP tunnels VRF-aware if binding to an l3mdev.

    Signed-off-by: Alexis Bauvin
    Reviewed-by: Amine Kherbouche
    Tested-by: Amine Kherbouche
    Signed-off-by: David S. Miller

    Alexis Bauvin
     

03 Nov, 2016

1 commit

  • Some IPCB fields are currently set in udp_tunnel6_xmit_skb(), which are
    never used before it reaches ip6tunnel_xmit(), and past that point the
    control buffer is no longer interpreted as IPCB.

    This clears these unused IPCB related codes. Currently there is no skb
    scrubbing in ip6_udp_tunnel, otherwise IPCB(skb)->opt might need to be
    cleared for IPv4 packets, as shown in 5146d1f1511
    ("tunnel: Clear IPCB(skb)->opt before dst_link_failure called").

    Signed-off-by: Eli Cooper
    Signed-off-by: David S. Miller

    Eli Cooper
     

12 Mar, 2016

1 commit

  • This patch extends udp_tunnel6_xmit_skb() to pass in the IPv6 flow label
    from call sites. Currently, there's no such option and it's always set to
    zero when writing ip6_flow_hdr(). Add a label member to ip_tunnel_key, so
    that flow-based tunnels via collect metadata frontends can make use of it.
    vxlan and geneve will be converted to add flow label support separately.

    Signed-off-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

30 Aug, 2015

1 commit

  • By default (subject to the sysctl settings), IPv6 sockets listen also for
    IPv4 traffic. Vxlan is not prepared for that and expects IPv6 header in
    packets received through an IPv6 socket.

    In addition, it's currently not possible to have both IPv4 and IPv6 vxlan
    tunnel on the same port (unless bindv6only sysctl is enabled), as it's not
    possible to create and bind both IPv4 and IPv6 vxlan interfaces and there's
    no way to specify both IPv4 and IPv6 remote/group IP addresses.

    Set IPV6_V6ONLY on vxlan sockets to fix both of these issues. This is not
    done globally in udp_tunnel, as l2tp and tipc seems to work okay when
    receiving IPv4 packets on IPv6 socket and people may rely on this behavior.
    The other tunnels (geneve and fou) do not support IPv6.

    Signed-off-by: Jiri Benc
    Signed-off-by: David S. Miller

    Jiri Benc
     

11 May, 2015

2 commits


08 Apr, 2015

1 commit


25 Jan, 2015

1 commit

  • The UDP tunnel transmit functions udp_tunnel_xmit_skb and
    udp_tunnel6_xmit_skb include a socket argument. The socket being
    passed to the functions (from VXLAN) is a UDP created for receive
    side. The only thing that the socket is used for in the transmit
    functions is to get the setting for checksum (enabled or zero).
    This patch removes the argument and and adds a nocheck argument
    for checksum setting. This eliminates the unnecessary dependency
    on a UDP socket for UDP tunnel transmit.

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     

26 Nov, 2014

1 commit

  • The UDP checksum calculation for VXLAN tunnels is currently using the
    socket addresses instead of the actual packet source and destination
    addresses. As a result the checksum calculated is incorrect in some
    cases.

    Also uh->check was being set twice, first it was set to 0, and then it is
    set again in udp6_set_csum. This change removes the redundant assignment
    to 0.

    Fixes: acbf74a7 ("vxlan: Refactor vxlan driver to make use of the common UDP tunnel functions.")

    Cc: Andy Zhou
    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     

23 Sep, 2014

1 commit

  • Unable to load various tunneling modules without this:

    [ 80.679049] fou: Unknown symbol udp_sock_create6 (err 0)
    [ 91.439939] ip6_udp_tunnel: Unknown symbol ip6_local_out (err 0)
    [ 91.439954] ip6_udp_tunnel: Unknown symbol __put_net (err 0)
    [ 91.457792] vxlan: Unknown symbol udp_sock_create6 (err 0)
    [ 91.457831] vxlan: Unknown symbol udp_tunnel6_xmit_skb (err 0)

    Signed-off-by: Tom Herbert
    Signed-off-by: David S. Miller

    Tom Herbert
     

20 Sep, 2014

2 commits

  • Added a few more UDP tunnel APIs that can be shared by UDP based
    tunnel protocol implementation. The main ones are highlighted below.

    setup_udp_tunnel_sock() configures UDP listener socket for
    receiving UDP encapsulated packets.

    udp_tunnel_xmit_skb() and upd_tunnel6_xmit_skb() transmit skb
    using UDP encapsulation.

    udp_tunnel_sock_release() closes the UDP tunnel listener socket.

    Signed-off-by: Andy Zhou
    Signed-off-by: David S. Miller

    Andy Zhou
     
  • Add ip6_udp_tunnel.c for ipv6 UDP tunnel functions to avoid ifdefs
    in udp_tunnel.c

    Signed-off-by: Andy Zhou
    Signed-off-by: David S. Miller

    Andy Zhou