From e079501ebc3e5595e232fd6c6e04b1f767ea450b Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Sun, 11 Jan 2026 23:11:48 +0100 Subject: [PATCH] bpf: clat: fix redirect for outgoing packets bpf_redirect_neigh() looks up the next hop in the routing table and then redirects the packet to the given ifindex. The problem is that the routing table might contain a default route with lower metric on a different device; in that case the FIB lookup returns a next hop on the other device, and the packet can't be delivered. Use bpf_redirect() instead; the IPv4 already has the right L2 destination because the IPv4 default route points to the IPv6 gateway. --- src/core/bpf/clat.bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/bpf/clat.bpf.c b/src/core/bpf/clat.bpf.c index bb4d93e16e..722c8731a7 100644 --- a/src/core/bpf/clat.bpf.c +++ b/src/core/bpf/clat.bpf.c @@ -554,7 +554,7 @@ clat_handle_v4(struct __sk_buff *skb) eth->h_proto = bpf_htons(ETH_P_IPV6); *ip6h = dst_hdr; - ret = bpf_redirect_neigh(skb->ifindex, NULL, 0, 0); + ret = bpf_redirect(skb->ifindex, 0); out: return ret; }