[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m234ppgv2m.fsf@ja.int.chopps.org>
Date: Fri, 07 Jun 2024 01:49:40 -0400
From: Christian Hopps <chopps@...pps.org>
To: Antony Antony <antony@...nome.org>
Cc: Christian Hopps <chopps@...pps.org>, devel@...ux-ipsec.org, Steffen
Klassert <steffen.klassert@...unet.com>, netdev@...r.kernel.org, Christian
Hopps <chopps@...n.net>
Subject: Re: [devel-ipsec] [PATCH ipsec-next v2 08/17] xfrm: iptfs: add new
iptfs xfrm mode impl
Antony Antony <antony@...nome.org> writes:
> Hi Chris,
>
> On Mon, May 20, 2024 at 05:42:46PM -0400, Christian Hopps via Devel wrote:
>> From: Christian Hopps <chopps@...n.net>
>> +static unsigned int iptfs_sa_len(const struct xfrm_state *x)
>> +{
>> + struct xfrm_iptfs_data *xtfs = x->mode_data;
>> + struct xfrm_iptfs_config *xc = &xtfs->cfg;
>> + unsigned int l = 0;
>> +
>> + l += nla_total_size(0);
>> + l += nla_total_size(sizeof(u16));
>> + l += nla_total_size(sizeof(xc->pkt_size));
>> + l += nla_total_size(sizeof(u32));
>> + l += nla_total_size(sizeof(u32)); /* drop time usec */
>> + l += nla_total_size(sizeof(u32)); /* init delay usec */
>> +
>> + return l;
>> +}
>> +
>> +static int iptfs_copy_to_user(struct xfrm_state *x, struct sk_buff *skb)
>> +{
>> + struct xfrm_iptfs_data *xtfs = x->mode_data;
>> + struct xfrm_iptfs_config *xc = &xtfs->cfg;
>> + int ret;
>> +
>> + ret = nla_put_flag(skb, XFRMA_IPTFS_DONT_FRAG);
>> + if (ret)
>> + return ret;
>> + ret = nla_put_u16(skb, XFRMA_IPTFS_REORDER_WINDOW, 0);
>> + if (ret)
>> + return ret;
>> + ret = nla_put_u32(skb, XFRMA_IPTFS_PKT_SIZE, xc->pkt_size);
>> + if (ret)
>> + return ret;
>> + ret = nla_put_u32(skb, XFRMA_IPTFS_MAX_QSIZE, 0);
>> + if (ret)
>> + return ret;
>> +
>> + ret = nla_put_u32(skb, XFRMA_IPTFS_DROP_TIME, 0);
>> + if (ret)
>> + return ret;
>> +
>> + ret = nla_put_u32(skb, XFRMA_IPTFS_INIT_DELAY, 0);
>
> Why copy all attributes? Only copy the ones relevant to the SA direction.
> Also adjust in iptfs_sa_len().
Updated in new v3 patchset.
Thanks,
Chris.
Download attachment "signature.asc" of type "application/pgp-signature" (858 bytes)
Powered by blists - more mailing lists