Netdev List
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ipip: reject unsupported configurations in fill_forward_path
Date: Sun, 26 Jul 2026 11:46:11 +0200	[thread overview]
Message-ID: <amXXY1_oi-TdPfzs@lore-desk> (raw)
In-Reply-To: <20260725-ipip-fill-forward-path-fix-v1-1-bc69fd3127d5@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1997 bytes --]

> The ipip fill_forward_path callback currently does not check for
> configurations that cannot be offloaded to hardware:
> 
> - Collect metadata (flow-based) tunnels have no fixed destination
>   and rely on per-packet tunnel metadata, so the forward path
>   cannot be pre-computed.
> 
> - TOS inheritance (parms.iph.tos & 0x1) requires copying the outer
>   TOS from the inner packet at encapsulation time, which is not
>   known during forward path resolution.
> 
> Return -EOPNOTSUPP for both cases to fall back to the software
> forwarding path.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  net/ipv4/ipip.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
> index d1aa048a6099..0831f6b81717 100644
> --- a/net/ipv4/ipip.c
> +++ b/net/ipv4/ipip.c
> @@ -360,6 +360,12 @@ static int ipip_fill_forward_path(struct net_device_path_ctx *ctx,
>  	const struct iphdr *tiph = &tunnel->parms.iph;
>  	struct rtable *rt;
>  
> +	if (tunnel->collect_md)
> +		return -EOPNOTSUPP;
> +
> +	if (tunnel->parms.iph.tos & 0x1)
> +		return -EOPNOTSUPP;
> +
>  	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, tiph->saddr,
>  			     inet_dsfield_to_dscp(tiph->tos),
>  			     tunnel->parms.link, RT_SCOPE_UNIVERSE);
> 

commenting on sashiko's report:
https://sashiko.dev/#/patchset/20260725-ipip-fill-forward-path-fix-v1-1-bc69fd3127d5%40kernel.org

- This is a pre-existing issue, but should the IPv6 equivalent callback,
  ip6_tnl_fill_forward_path() in net/ipv6/ip6_tunnel.c, also receive similar
  checks?
  - already fixed in the following patch:
    https://lore.kernel.org/netdev/20260724-ip6ip6-route-lookup-fill_forward_path-v3-1-7b7991538614@kernel.org/

Regards,
Lorenzo

> ---
> base-commit: 04026c998c24ac47eb76886b9790c5710b603eb4
> change-id: 20260725-ipip-fill-forward-path-fix-543c41000a57
> 
> Best regards,
> -- 
> Lorenzo Bianconi <lorenzo@kernel.org>
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-07-26  9:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25  9:33 [PATCH net-next] ipip: reject unsupported configurations in fill_forward_path Lorenzo Bianconi
2026-07-26  9:46 ` Lorenzo Bianconi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=amXXY1_oi-TdPfzs@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox