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

From: Simon Horman <[email-masked]>
Date: Mon, 15 Jul 2024 14:16:19 +0100

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

...