News for hackers. Stuff that matters.
Re:BPF, XDP, Packet Filters and UDP by bogomipz on Wednesday October 21, 2020 @04:55PM (#24852081)
I see. Thanks for the clarification. I need to read up more on XDP Schemas and headers. Might you or anyone else have any resources you found helpful?
Re:BPF, XDP, Packet Filters and UDP by tptacek on Wednesday October 21, 2020 @06:20PM (#24852878)
There's not much to know! "XDP" is really just the Linux term of art for "BPF running directly off the network driver". Your BPF program --- ordinarily, just a C program you compiled with clang --- is given a struct with pointers to the beginning and end of a packet, and your program can return OK, DROP, or REDIRECT, in addition to modifying the packet.

The XDP project itself has a pretty excellent tutorial:

https://github.com/xdp-project/xdp-tutorial