OSDN Git Service

ip_tunnel: Make vti work with i_key set
authorSteffen Klassert <steffen.klassert@secunet.com>
Fri, 21 Feb 2014 07:41:09 +0000 (08:41 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Tue, 25 Feb 2014 06:04:18 +0000 (07:04 +0100)
commit6d608f06e390d803c1d0e604cae280f1e708bf68
tree0a67e04e0ff7b92c59e2a11b9702d314237bc6bb
parent70be6c91c86596ad2b60c73587880b47df170a41
ip_tunnel: Make vti work with i_key set

Vti uses the o_key to mark packets that were transmitted or received
by a vti interface. Unfortunately we can't apply different marks
to in and outbound packets with only one key availabe. Vti interfaces
typically use wildcard selectors for vti IPsec policies. On forwarding,
the same output policy will match for both directions. This generates
a loop between the IPsec gateways until the ttl of the packet is
exceeded.

The gre i_key/o_key are usually there to find the right gre tunnel
during a lookup. When vti uses the i_key to mark packets, the tunnel
lookup does not work any more because vti does not use the gre keys
as a hash key for the lookup.

This patch workarounds this my not including the i_key when comupting
the hash for the tunnel lookup in case of vti tunnels.

With this we have separate keys available for the transmitting and
receiving side of the vti interface.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/ip_tunnel.c