Re: [PATCH net v3 2/4] ip_tunnel: move the TCP fixed-ID flag to the inner header

From: Julius Bairaktaris

Date: Sun Nov 01 2026 - 11:50:22 EST


> [Severity: Medium]
> iptunnel_handle_offloads() is not only used by the IP-in-IP tunnels.
[ ... ]
> Wouldn't the inner header then get iph->id = htons(id++) on every
> segment?

Agreed. gre_gso_segment() and __skb_udp_tunnel_segment() reset
encap_level before the inner inet_gso_segment(), which then tests
SKB_GSO_TCP_FIXEDID, so for an IPv6 outer header the patch turns kept
inner IDs into incrementing ones.

> [Severity: High]
> This assumes SKB_GSO_TCP_FIXEDID always describes the current outermost
> header when skb->encapsulation is 0. Does the decap side keep that true?

Agreed. iptunnel_pull_offloads() and bpf_skb_net_shrink() leave both
fixed-ID bits where they were, so after a decap SKB_GSO_TCP_FIXEDID still
describes the removed header. That is older than this patch: GRO sets
the inner bit for the inner header since 3271f19bf7b9, and nothing moves
it back on decap.

Multicast routing does not carry TCP, so the ipmr fix does not need this
patch, and v4 drops it. The fixed-ID state across encap, decap and the
GRE/UDP segmentation path is fixed separately in "[PATCH net 0/2] net:
keep the TCP fixed-ID flags on the header they describe":
https://lore.kernel.org/netdev/cover.1792857378.git.julius@xxxxxxxxxxxxxx/