zoidyzoidzoid/awesome-ebpf

Using eBPF to hook tx packet

liuhycn opened this issue · 2 comments

Using eBPF to hook tx packet

I want to use ebpf to hook the packets sent by the NIC and modify them. I saw an example of using ebpf to hook the received packets by a NIC in the tutorial, but I did not find an example of hooking to send packets.

Hi, I am not sure what tutorial you refer to, or what this issue has to do with the current repository? This is not a tutorial, but simply a list of resources.

As for your question, writing programs to modify packets on the egress path works just like for ingress path. There's just the hooks that differ: You would attach to an egress qdisc with tc, (no XDP, as I don't believe egress XDP is supported yet, at least not in a straightforward way).