mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-17 03:30:40 +01:00
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.
This commit is contained in:
parent
02814a0a60
commit
e079501ebc
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue