summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorDaniel Borkmann2017-01-24 01:06:28 +0100
committerDavid S. Miller2017-01-24 20:46:06 +0100
commitd1b662adcdb87944b7f6f7bd2f95cbb1404dbf18 (patch)
treece847a4583aff07f03b6218180915d066949d403 /include/uapi/linux/bpf.h
parentbpf: enable load bytes helper for filter/reuseport progs (diff)
downloadkernel-qcow2-linux-d1b662adcdb87944b7f6f7bd2f95cbb1404dbf18.tar.gz
kernel-qcow2-linux-d1b662adcdb87944b7f6f7bd2f95cbb1404dbf18.tar.xz
kernel-qcow2-linux-d1b662adcdb87944b7f6f7bd2f95cbb1404dbf18.zip
bpf: allow option for setting bpf_l4_csum_replace from scratch
When programs need to calculate the csum from scratch for small UDP packets and use bpf_l4_csum_replace() to feed the result from helpers like bpf_csum_diff(), then we need a flag besides BPF_F_MARK_MANGLED_0 that would ignore the case of current csum being 0, and which would still allow for the helper to set the csum and transform when needed to CSUM_MANGLED_0. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index bd3068485410..e07fd5a324e6 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -522,6 +522,7 @@ enum bpf_func_id {
/* BPF_FUNC_l4_csum_replace flags. */
#define BPF_F_PSEUDO_HDR (1ULL << 4)
#define BPF_F_MARK_MANGLED_0 (1ULL << 5)
+#define BPF_F_MARK_ENFORCE (1ULL << 6)
/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
#define BPF_F_INGRESS (1ULL << 0)