Re: [PATCH net v5 3/4] ipmr: set up GSO state for tunnel vifs
From: netdev-bot+sashiko
Date: Sun Nov 15 2026 - 19:47:37 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The new early drop in the VIFF_TUNNEL branch of
ipmr_prepare_xmit() (net/ipv4/ipmr.c:1959-1960, `if (skb_is_gso(skb)…
--
ipmr: set up GSO state for tunnel vifs
This commit sets up the GSO state in ip_encap() for VIFF_TUNNEL vifs. It
calls iptunnel_handle_offloads() and skb_set_inner_ipproto(), reserves one
outer IP ID per segment, and sets the outer length with iph_set_totlen().
It also drops GSO packets that are already marked as encapsulated before
they reach a tunnel vif.
> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
> index 836f3f95b20c4..09d6b0ff1ffb7 100644
> --- a/net/ipv4/ipmr.c
> +++ b/net/ipv4/ipmr.c
[ ... ]
> @@ -1951,6 +1955,9 @@ static int ipmr_prepare_xmit(struct net *net, struct mr_table *mrt,
> }
>
> if (vif->flags & VIFF_TUNNEL) {
> + /* The inner headers can describe one tunnel only */
> + if (skb_is_gso(skb) && skb->encapsulation)
> + return -1;
[Severity: Medium]
Does this check also drop IPIP and SIT GRO aggregates that used to be
forwarded correctly?
ipip_gro_complete() in net/ipv4/af_inet.c and sit_gro_complete() in
net/ipv6/ip6_offload.c both set the encapsulation bit and the IPXIP4 GSO
type:
skb->encapsulation = 1;
skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP4;
ipip_gso_segment() and sit_gso_segment() only reject packets that lack
SKB_GSO_IPXIP4:
if (!(skb_shinfo(skb)->gso_type & SKB_GSO_IPXIP4))
return ERR_PTR(-EINVAL);
return inet_gso_segment(skb, features);
Before this patch, an IPIP-in-IPIP or SIT-in-IPIP aggregate passed this
check. inet_gso_segment() then recursed through each IP layer and fixed
tot_len, id and the checksum at every level. The MTU check in
ip_finish_output_gso() also looked right, because
skb_gso_transport_seglen() counts the inner headers when encapsulation is
set.
With this patch, these packets return -1 before the route lookup. The
callers then free them with no MIB counter bumped:
ip_mr_forward()->ipmr_queue_fwd_xmit()
if (ipmr_prepare_xmit(net, mrt, skb, vifi))
goto out_free;
...
out_free:
kfree_skb(skb);
ipmr_queue_output_xmit() behaves the same way.
The commit message says these packets are dropped "as segmentation
dropped it before". Is that only true for GRE and UDP tunnel GSO types
that do not carry SKB_GSO_IPXIP4?
This check is unchanged at the end of the series, so the later commit
"ipmr: do not drop GSO packets that fit the MTU after segmentation" does
not fix it. That later commit would otherwise let DF-set aggregates of
this kind through the MTU check, but this drop stops them first.
Would a narrower condition keep the previous behaviour for these
packets? For example, the drop could be skipped when gso_type already
contains SKB_GSO_IPXIP4.
> rt = ip_route_output_ports(net, &fl4, NULL,
> vif->remote, vif->local,
> 0, 0,
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794151759.git.julius%40bairaktaris.de