summary refs log tree commit diff
path: root/arch/x86/net/bpf_jit_comp.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-05-04 01:08:15 +0200
committerAlexei Starovoitov <ast@kernel.org>2018-05-03 16:49:19 -0700
commit4e1ec56cdc59746943b2acfab3c171b930187bbe (patch)
treec7bc363b064ec1d5a3917de49d90696c8794e361 /arch/x86/net/bpf_jit_comp.c
parente0cea7ce988cf48cc4052235d2ad2550b3bc4fa0 (diff)
downloadlinux-4e1ec56cdc59746943b2acfab3c171b930187bbe.tar.gz
bpf: add skb_load_bytes_relative helper
This adds a small BPF helper similar to bpf_skb_load_bytes() that
is able to load relative to mac/net header offset from the skb's
linear data. Compared to bpf_skb_load_bytes(), it takes a fifth
argument namely start_header, which is either BPF_HDR_START_MAC
or BPF_HDR_START_NET. This allows for a more flexible alternative
compared to LD_ABS/LD_IND with negative offset. It's enabled for
tc BPF programs as well as sock filter program types where it's
mainly useful in reuseport programs to ease access to lower header
data.

Reference: https://lists.iovisor.org/pipermail/iovisor-dev/2017-March/000698.html
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'arch/x86/net/bpf_jit_comp.c')
0 files changed, 0 insertions, 0 deletions