Re: [PATCH net-next v4 05/12] amt: forward multicast data over IPv6
From: Omar Ramadan
Date: Mon Nov 30 2026 - 01:41:19 EST
On Mon, 30 Nov 2026 03:48:32 +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> Does the saved th_off actually account for extension headers on the
> relay's usual input path, IPv6 multicast forwarded by ip6mr?
Only for a Hop-by-Hop header, and you are right about the rest.
ip6_rcv_core() sets the transport header to the network header plus 40,
ipv6_parse_hopopts() moves it past a Hop-by-Hop header, and nothing on
the forwarding path moves it past a Destination Options or Routing
header. For those the restored offset is the end of the fixed header.
> Can this under-count each segment by the length of the extension
> headers, so that segments up to that many bytes over the tunnel MTU
> pass the check?
Yes, for such a packet, by the length of those headers. I did not change
it, because it is not specific to the relay: ip6_forward() and
ip6_finish_output_gso(), where ip6mr forwarding ends, validate a GSO skb
with skb_gso_validate_network_len() from the same offset, so the same
skb is counted the same way when it is forwarded. The patch puts back
the offset the skb had on entry, which is no worse than the rest of the
IPv6 forwarding path. Making the offset exact for every extension header
means walking them with ipv6_skip_exthdr() on this path, or changing the
receive path, and I would rather not put that in this series. The inner
header offsets are copied from this one, so the outer check inherits the
same count: segments up to the length of those headers over the route
MTU can leave the relay and be dropped at the link. I have not made that
exact either.
v5 says this in the message and in the comment. v4's comment said that
the restore makes the per-segment length count extension headers, which
was too strong.
--
Omar