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

From: Christian Hopps <[email-masked]>
Date: Thu, 11 Apr 2024 12:40:30 -0400

Paul Wouters via Devel <[email-masked]> writes:

> 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.

I have to agree. When we add new direction specific attributes (e.g., iptfs send-rate, pkt-size, etc, for "out", reorder window size, drop-time for "in") changing direction would mean removing invalidating these attributes and possibly setting new different ones, deleting old send state adding new receive state, etc.. this doesn't feel like an SA update IMO, it feels like a new SA. I say we should apply KISS and just require a new SA for a different direction attribute.

Thanks,
Chris.

> Paul