[PATCH net-next v5 14/14] vxlan: report a circular route as SKB_DROP_REASON_RECURSION_LIMIT
From: Anton Danilov
Date: Wed Sep 30 2026 - 14:53:33 EST
udp_tunnel_dst_lookup() and udp_tunnel6_dst_lookup() return -ELOOP
when the route to the remote end goes out of the vxlan device itself,
and vxlan_xmit_one() counts that in collisions, apart from the
-ENETUNREACH of a failed lookup. The drop reason does not tell them
apart: both are reported as SKB_DROP_REASON_IP_OUTNOROUTES, which
describes a failed route lookup.
ip_tunnel and ip6_tunnel make the same check, rt->dst.dev == dev in
ip_tunnel_xmit() and ip_md_tunnel_xmit() and tdev == dev in
ip6_tnl_xmit(), and report it as SKB_DROP_REASON_RECURSION_LIMIT since
earlier in this series. Report the vxlan case the same way, so that
vxlan and these tunnels name this misconfiguration with one reason.
Assisted-by: LLM
Signed-off-by: Anton Danilov <littlesmilingcloud@xxxxxxxxx>
---
drivers/net/vxlan/vxlan_core.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index 0d98e29e2d72..7c94a630d184 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -2547,7 +2547,10 @@ void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
tos, use_cache ? dst_cache : NULL);
if (IS_ERR(rt)) {
err = PTR_ERR(rt);
- reason = SKB_DROP_REASON_IP_OUTNOROUTES;
+ if (err == -ELOOP)
+ reason = SKB_DROP_REASON_RECURSION_LIMIT;
+ else
+ reason = SKB_DROP_REASON_IP_OUTNOROUTES;
goto tx_error;
}
@@ -2633,7 +2636,10 @@ void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
if (IS_ERR(ndst)) {
err = PTR_ERR(ndst);
ndst = NULL;
- reason = SKB_DROP_REASON_IP_OUTNOROUTES;
+ if (err == -ELOOP)
+ reason = SKB_DROP_REASON_RECURSION_LIMIT;
+ else
+ reason = SKB_DROP_REASON_IP_OUTNOROUTES;
goto tx_error;
}
--
2.47.3