Jussi Maki 6fd5fb6382 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
2021-05-25 18:00:28 +02:00
..
2021-04-26 10:25:03 -07:00
2020-12-07 14:34:55 -07:00
2021-03-08 11:59:16 +01:00
2021-01-29 18:03:33 -08:00
2021-05-02 00:43:35 +09:00
2021-05-06 19:24:11 -07:00
2021-02-22 17:15:30 -08:00
2021-04-29 11:57:23 -07:00