diff options
author | Jussi Maki <joamaki@gmail.com> | 2021-05-25 13:29:55 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-05-25 19:00:28 +0300 |
commit | 6fd5fb63820a9a1146aba0bba2fdbc1db4b903e7 (patch) | |
tree | 24f7d28c24b6eea45a9228d6bd8f59d18d4f86d7 /kernel/bpf | |
parent | a8deba8547e39f26440101164a3bbc2899c5b305 (diff) | |
download | linux-6fd5fb63820a9a1146aba0bba2fdbc1db4b903e7.tar.xz |
selftests/bpf: Add test for l3 use of bpf_redirect_peer
Add a test case for using bpf_skb_change_head() in combination with
bpf_redirect_peer() to redirect a packet from a L3 device to veth and back.
The test uses a BPF program that adds L2 headers to the packet coming
from a L3 device and then calls bpf_redirect_peer() to redirect the packet
to a veth device. The test fails as skb->mac_len is not set properly and
thus the ethernet headers are not properly skb_pull'd in cls_bpf_classify(),
causing tcp_v4_rcv() to point the TCP header into middle of the IP header.
Signed-off-by: Jussi Maki <joamaki@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210525102955.2811090-1-joamaki@gmail.com
Diffstat (limited to 'kernel/bpf')
0 files changed, 0 insertions, 0 deletions