Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] ipip: reject unsupported configurations in fill_forward_path
@ 2026-07-25  9:33 Lorenzo Bianconi
  2026-07-26  9:46 ` Lorenzo Bianconi
  2026-07-30 11:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2026-07-25  9:33 UTC (permalink / raw)
  To: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: netdev, Lorenzo Bianconi

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);

---
base-commit: 04026c998c24ac47eb76886b9790c5710b603eb4
change-id: 20260725-ipip-fill-forward-path-fix-543c41000a57

Best regards,
-- 
Lorenzo Bianconi <lorenzo@kernel.org>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-30 11:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-07-30 11:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox