Subject: Re: [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 14:41:32 +0300

On Thu, Apr 11, 2024 at 11:40:59AM +0200, Antony Antony wrote:
> This patch introduces the 'dir' attribute, 'in' or 'out', to the
> xfrm_state, SA, enhancing usability by delineating the scope of values
> based on direction. An input SA will now exclusively encompass values
> pertinent to input, effectively segregating them from output-related
> values. This change aims to streamline the configuration process and
> improve the overall clarity of SA attributes.
> 
> This feature sets the groundwork for future patches, including
> the upcoming IP-TFS patch.
> 
> Signed-off-by: Antony Antony <[email-masked]>
> ---
> v9->v10:
>  - add more direction specific validations
> 	XFRM_STATE_NOPMTUDISC, XFRM_SA_XFLAG_DONT_ENCAP_DSCP
> 	XFRMA_MTIMER_THRESH
>  - refactor validations into a fuction.
>  - add dir to ALLOCSPI to support strongSwan updating SPI for "in" state
> v8->v9:
>  - add validation XFRM_STATE_ICMP not allowed on OUT SA.
> 
> v7->v8:
>  - add extra validation check on replay window and seq
>  - XFRM_MSG_UPDSA old and new SA should match "dir"

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.

Thanks