summaryrefslogtreecommitdiffstats
path: root/arch/x86/net/bpf_jit_comp.c
diff options
context:
space:
mode:
authorDaniel Borkmann2018-05-04 01:08:15 +0200
committerAlexei Starovoitov2018-05-04 01:49:19 +0200
commit4e1ec56cdc59746943b2acfab3c171b930187bbe (patch)
treec7bc363b064ec1d5a3917de49d90696c8794e361 /arch/x86/net/bpf_jit_comp.c
parentbpf: implement ld_abs/ld_ind in native bpf (diff)
downloadkernel-qcow2-linux-4e1ec56cdc59746943b2acfab3c171b930187bbe.tar.gz
kernel-qcow2-linux-4e1ec56cdc59746943b2acfab3c171b930187bbe.tar.xz
kernel-qcow2-linux-4e1ec56cdc59746943b2acfab3c171b930187bbe.zip
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