ip_tunnels: record IP version in tunnel info
authorJiri Benc <jbenc@redhat.com>
Fri, 28 Aug 2015 18:48:20 +0000 (20:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Aug 2015 20:07:54 +0000 (13:07 -0700)
commit7f9562a1f405306eacb97f95d78cb996e33f27f5
tree298378f868e85024a908e9bae1e0754fc59e169e
parent46fa062ad63146dd138ec0f017e71224471e8ea5
ip_tunnels: record IP version in tunnel info

There's currently nothing preventing directing packets with IPv6
encapsulation data to IPv4 tunnels (and vice versa). If this happens,
IPv6 addresses are incorrectly interpreted as IPv4 ones.

Track whether the given ip_tunnel_key contains IPv4 or IPv6 data. Store this
in ip_tunnel_info. Reject packets at appropriate places if they are supposed
to be encapsulated into an incompatible protocol.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/geneve.c
drivers/net/vxlan.c
include/net/dst_metadata.h
include/net/ip_tunnels.h
net/core/filter.c
net/ipv4/ip_gre.c
net/ipv4/ip_tunnel_core.c
net/openvswitch/flow.c
net/openvswitch/vport.c