Home
last modified time | relevance | path

Searched hist:"6 fd5fb63820a9a1146aba0bba2fdbc1db4b903e7" (Results 1 – 2 of 2) sorted by relevance

/openbmc/linux/tools/testing/selftests/bpf/progs/
H A Dtest_tc_peer.cdiff 6fd5fb63820a9a1146aba0bba2fdbc1db4b903e7 Tue May 25 05:29:55 CDT 2021 Jussi Maki <joamaki@gmail.com> 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
/openbmc/linux/tools/testing/selftests/bpf/prog_tests/
H A Dtc_redirect.cdiff 6fd5fb63820a9a1146aba0bba2fdbc1db4b903e7 Tue May 25 05:29:55 CDT 2021 Jussi Maki <joamaki@gmail.com> 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