Subject: Re: [PATCH net v3] vti: fix spd lookup: match plaintext pkt, not ipsec pkt

From: Steffen Klassert <[email-masked]>
Date: Thu, 7 Nov 2013 12:25:49 +0100

On Wed, Nov 06, 2013 at 09:05:53AM +0100, Christophe Gouault wrote:
> The vti interface inbound and outbound SPD lookups are based on the
> ipsec packet instead of the plaintext packet.
> 
> Not only is it counterintuitive, it also restricts vti interfaces
> to a single policy (whose selector must match the tunnel local and
> remote addresses).
> 
> The policy selector is supposed to match the plaintext packet, before
> encryption or after decryption.
> 
> This patch performs the SPD lookup based on the plaintext packet. It
> enables to create several polices bound to the vti interface (via a
> mark equal to the vti interface okey).
> 
> It remains possible to apply the same policy to all packets entering
> the vti interface, by setting an any-to-any selector (src 0.0.0.0/0
> dst 0.0.0.0/0 proto any mark OKEY).
> 
> Signed-off-by: Christophe Gouault <[email-masked]>

Hm, this patch breaks my current vti test setup. I would need to
configure the policies and states dependent on the kernel version
if we apply this patch...

It would be good to hear from the original author of the vti code
whether the current behaviour is intentional before we do anything
here.