]> git.feebdaed.xyz Git - 0xmirror/cilium.git/commit
bpf: remove redundant destination mac rewrite in bpf_lxc
authorLouis DeLosSantos <louis.delos@isovalent.com>
Tue, 16 Dec 2025 16:13:59 +0000 (11:13 -0500)
committerLouis DeLosSantos <louis.delos@isovalent.com>
Thu, 18 Dec 2025 13:56:21 +0000 (13:56 +0000)
commitfdf020e91e7024d231cf857c4b426dd1af673d25
treef32cb617f1823f4bc8e78b7b500951fa2b709aad
parent098d903b093b9b8526fe1688aa55b641e6012f87
bpf: remove redundant destination mac rewrite in bpf_lxc

After several cups of coffee and internal banter we have determined that this
mac rewrite is unnecessary.

The destination mac rewrites occur just prior to being submitted to the
stack. The host network namespace will perform layer 3 routing and
rewrite the mac subsequently regardless of our original rewrite. The
layer 3 path also decrements the TTL, making this redundant as well.

Additionally, in both Veth and Netkit forwarding paths
`eth_type_trans()` and its sibling `eth_skb_pkt_type` are called,
respectively, to set the packet's type PRIOR to our eBPF program running, so
any modification to the destination MAC in the effort to ensure packet reception
into layer 3 does not make sense.

The genesis of this redirect is from commit:
```
commit 99108598251cf4db382e6e6e0cef9d76a47a93ca
Author: Thomas Graf <thomas@cilium.io>
Date:   Thu Jan 28 00:19:17 2016 +0100

    Use the MAC of the host facing veth end as router MAC
```

In the above commit the original destination MAC rewrite was put in place.
This was redundant even at the genesis for the reasons mentioned above.

Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
bpf/bpf_lxc.c