Subject: Re: [devel-ipsec] [PATCH ipsec-next v10 1/3] xfrm: Add Direction to the SA in or out

From: Leon Romanovsky <[email-masked]>
Date: Thu, 11 Apr 2024 20:05:29 +0300

On Thu, Apr 11, 2024 at 12:20:31PM -0400, Paul Wouters wrote:
> On Apr 11, 2024, at 07:41, Leon Romanovsky via Devel <[email-masked]> wrote:
> > 
> > 
> > I asked it on one of the previous versions, but why do we need this limitation?
> > Update SA is actually add and delete, so if user wants to update
> > direction, it should be allowed.
> 
> An SA can never change direction without dealing with updated SPIs. Logically, it makes no sense. Sure, if you treat SA’s as Linux lego bricks that can be turned into anything, then yeah why not. Why not turn the SA into block device or magic flute?
> 
> If you keep to the RFC, an SA is uni directional. More things might apply too, eg the mode (transport vs tunnel) should not change, sequence numbers can only increase, etc.

Right, and it looks like preventing change of direction is only small
part of larger task - "improve validation of SA updates".

Thanks

> Paul