diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-05-04 01:08:15 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-05-04 01:49:19 +0200 |
commit | 4e1ec56cdc59746943b2acfab3c171b930187bbe (patch) | |
tree | c7bc363b064ec1d5a3917de49d90696c8794e361 /arch/x86/net | |
parent | bpf: implement ld_abs/ld_ind in native bpf (diff) | |
download | linux-4e1ec56cdc59746943b2acfab3c171b930187bbe.tar.xz 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')
0 files changed, 0 insertions, 0 deletions