Subject: Re: [devel-ipsec] [PATCH ipsec-next v5 12/17] xfrm: iptfs: add basic receive packet (tunnel egress) handling

From: Christian Hopps <[email-masked]>
Date: Wed, 17 Jul 2024 23:14:53 -0700

Simon Horman via Devel <[email-masked]> writes:

> On Sun, Jul 14, 2024 at 04:22:40PM -0400, Christian Hopps wrote:
>> From: Christian Hopps <[email-masked]>
>>
>> Add handling of packets received from the tunnel. This implements
>> tunnel egress functionality.
>>
>> Signed-off-by: Christian Hopps <[email-masked]>
>> ---
>>  net/xfrm/xfrm_iptfs.c | 283 ++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 283 insertions(+)
>>
>> diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c
>> index 933df59cd39d..0060f8825599 100644
>
> ...
>
>> +/**
>> + * iptfs_input() - handle receipt of iptfs payload
>> + * @x: xfrm state
>> + * @skb: the packet
>> + *
>> + * Process the IPTFS payload in `skb` and consume it afterwards.
>> + */
>> +static int iptfs_input(struct xfrm_state *x, struct sk_buff *skb)
>> +{
>> +	u8 hbytes[sizeof(struct ipv6hdr)];
>> +	struct ip_iptfs_cc_hdr iptcch;
>> +	struct skb_seq_state skbseq;
>> +	struct list_head sublist; /* rename this it's just a list */
>> +	struct sk_buff *first_skb, *next;
>> +	const unsigned char *old_mac;
>> +	struct xfrm_iptfs_data *xtfs;
>> +	struct ip_iptfs_hdr *ipth;
>> +	struct iphdr *iph;
>> +	struct net *net;
>> +	u32 remaining, iplen, iphlen, data, tail;
>> +	u32 blkoff;
>> +	u64 seq;
>> +
>> +	xtfs = x->mode_data;
>
> Hi Christian,
>
> xtfs is set but otherwise unused in this function.
>
> Flagged by W=1 x86_64 allmodconfig builds with gcc-14 and clang-18.
>
>> +	net = dev_net(skb->dev);
>> +	first_skb = NULL;
>> +
>> +	seq = __esp_seq(skb);
>
> Likewise, seq is set but otherwise unused in this function
>
> ...

These are another artifact of the splitting the commits, they get used in the later commits to this file. In any case I've removed them from this particular commit in the meantime.

Thanks!
Chris.