]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: add flow dissector bpf_skb_load_bytes helper test
authorStanislav Fomichev <sdf@google.com>
Mon, 22 Apr 2019 15:55:49 +0000 (08:55 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 23 Apr 2019 16:36:34 +0000 (18:36 +0200)
commit2411343c6b726d979e20f2088f24a64ca3b580d5
tree5223f0713124af66fc29f16bedae1c16c38a717f
parent8c6cf8f1593a61c875cde00f0722ab9859ed9d53
selftests/bpf: add flow dissector bpf_skb_load_bytes helper test

When flow dissector is called without skb, we want to make sure
bpf_skb_load_bytes invocations return error. Add small test which tries
to read single byte from a packet.

bpf_skb_load_bytes should always fail under BPF_PROG_TEST_RUN because
it was converted to the skb-less mode.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/prog_tests/flow_dissector_load_bytes.c [new file with mode: 0644]