Re: [PATCH net v2] fou: ensure GUE headers have enough headroom
From: Chengfeng Ye
Date: Mon Aug 24 2026 - 07:24:52 EST
On Mon, Aug 24, 2026 at 3:50 PM Ido Schimmel <idosch@xxxxxxxxxx> wrote:
>
> It is up to the caller of ip_tunnel_encap() to make sure that there is
> enough headroom in the packet. Otherwise, what is the point of the
> encap_hlen() callback? Also, adding skb_cow_head() in the build_header()
> callback forces every caller to refresh pointers to skb->head.
>
> There's a WIP patch to fix the same problem in IPv6 [1]. I suggest doing
> something similar in ip_tunnel_xmit() and ip_md_tunnel_xmit(). Note that
> IPv6 reserves the headroom before the encap push, so the snapshot is
> enough there. IPv4 reserves it after, so we also need an skb_cow_head()
> before ip_tunnel_encap().
>
> [1] https://lore.kernel.org/netdev/cover.1786088695.git.petalzu987@xxxxxxxxx/
Thanks for the guide, I just created a v3 to fix the problem using the
similar way as that ipv6 patch by adjusting the callsite.
Best regards,
Chengfeng