Re: [PATCH net 3/6] seg6: update skb checksum when SRv6 behaviors advance to the next SID
From: Andrea Mayer
Date: Wed Nov 04 2026 - 16:49:17 EST
On Tue, 3 Nov 2026 10:15:03 +0800
Hangbin Liu <hangbin.liu@xxxxxxxxx> wrote:
> [snip]
> > + if (skb->ip_summed == CHECKSUM_COMPLETE) {
> > + update_csum_diff4(skb, old, *(__be32 *)srh);
> > + update_csum_diff16(skb, (__be32 *)daddr, (__be32 *)addr);
> > + }
> > +
> > + *daddr = *addr;
>
> Nit: we can re-use seg6_update_csum() if the transport header set correctly.
> But that function is static and we need adjust header files.
> So the current change looks good for me.
> [snip]
Hi Hangbin,
I thought about something similar. seg6_local finds the SRH with
seg6_get_srh(), and the SRH is not always where the transport header
points, for example with a Destination Options header before it. Passing
the SRH to seg6_update_csum() and moving it to include/net/seg6.h would
make it usable in seg6_local. I will likely propose this for net-next,
after this series, to avoid changing more files than needed in this fix.
Thanks for the review,
Andrea