• Jiri Benc's avatar
    vxlan: do not receive IPv4 packets on IPv6 socket · a43a9ef6
    Jiri Benc authored
    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: default avatarJiri Benc <jbenc@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a43a9ef6
udp_tunnel.h 3.24 KB