MTU testing
Simple TC-BPF program for testing different packets sizes that violate the MTU of the interface.
This is part of testing upstream kernel work, for removing the MTU limit in the BPF-helpers that change packet size, and instead add BPF-helper that can check or lookup interface MTU.
Encode this statically via C/BPF-code switch statement, and
have global counter cycles through these.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Shot myself in the foot with stripping ELF obj file.
This was the reason I could not load BPF program with TC.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This code only works because LLVM optimize it as a constant.
As soon at I try to use it as variable it breaks.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
It still works when loading, but results in a huge warning
which is really annoying.
Add a Makefile hack to strip the object file.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This makes it easier to see/decode packets via tcpdump.
Borrowing part of ../encap-forward/encap.h.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
If the BPF LSM is compiled-in but not enabled, the loading of the BPF
program will succeed, but it won't actually do anything. Detect this
and abort rather than silently not working.
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>