OSDN Git Service

vti: Update the ipv4 side to use it's own receive hook.
authorSteffen Klassert <steffen.klassert@secunet.com>
Fri, 21 Feb 2014 07:41:10 +0000 (08:41 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Tue, 25 Feb 2014 06:04:18 +0000 (07:04 +0100)
commitdf3893c176e9b0bb39b28ab5ec8113fa20ad1ee0
tree789c670133d5cbf000633d2be1416db3cd29da31
parent6d608f06e390d803c1d0e604cae280f1e708bf68
vti: Update the ipv4 side to use it's own receive hook.

With this patch, vti uses the IPsec protocol multiplexer to
register it's own receive side hooks for ESP, AH and IPCOMP.

Vti now does the following on receive side:

1. Do an input policy check for the IPsec packet we received.
   This is required because this packet could be already
   prosecces by IPsec, so an inbuond policy check is needed.

2. Mark the packet with the i_key. The policy and the state
   must match this key now. Policy and state belong to the outer
   namespace and policy enforcement is done at the further layers.

3. Call the generic xfrm layer to do decryption and decapsulation.

4. Wait for a callback from the xfrm layer to properly clean the
   skb to not leak informations on namespace and to update the
   device statistics.

On transmit side:

1. Mark the packet with the o_key. The policy and the state
   must match this key now.

2. Do a xfrm_lookup on the original packet with the mark applied.

3. Check if we got an IPsec route.

4. Clean the skb to not leak informations on namespace
   transitions.

5. Attach the dst_enty we got from the xfrm_lookup to the skb.

6. Call dst_output to do the IPsec processing.

7. Do the device statistics.

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