Re: [RFC net-next 05/15] ipxlat: add IPv6 packet validation path
From: Xavier HSINYUAN
Date: Wed Apr 08 2026 - 22:19:14 EST
Hi Ralf,
>+static int ipxlat_v6_validate_icmp_csum(const struct sk_buff *skb)
>+{
>+ struct ipv6hdr *iph6;
>+ unsigned int len;
>+ __sum16 csum;
>+
>+ if (skb->ip_summed != CHECKSUM_NONE)
>+ return 0;
>+
>+ iph6 = ipv6_hdr(skb);
>+ len = ipxlat_skb_datagram_len(skb);
>+ csum = csum_ipv6_magic(&iph6->saddr, &iph6->daddr, len, NEXTHDR_ICMP,
>+ skb_checksum(skb, skb_transport_offset(skb), len,
>+ 0));
>+
>+ return unlikely(csum) ? -EINVAL : 0;
>+}
We should include net/ip6_checksum.h to make x86_64 with KMSAN/KASAN and
other architectures with optional _HAVE_ARCH_IPV6_CSUM happy.
Best regards,
Xavier