summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartynas Pumputis <m@lambda.lt>2019-06-12 19:05:40 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-03 14:13:42 +0300
commit7108c83502e822e52052eea7d13f9d3d8bc8dea0 (patch)
tree8a0926ac0ff03518cc46fa82bc956a6a5745abfd
parent03c3e507e90eb4fc528ed52e77d9f9ae8e4edd64 (diff)
downloadlinux-7108c83502e822e52052eea7d13f9d3d8bc8dea0.tar.xz
bpf: simplify definition of BPF_FIB_LOOKUP related flags
commit b1d6c15b9d824a58c5415673f374fac19e8eccdf upstream. Previously, the BPF_FIB_LOOKUP_{DIRECT,OUTPUT} flags in the BPF UAPI were defined with the help of BIT macro. This had the following issues: - In order to use any of the flags, a user was required to depend on <linux/bits.h>. - No other flag in bpf.h uses the macro, so it seems that an unwritten convention is to use (1 << (nr)) to define BPF-related flags. Fixes: 87f5fc7e48dd ("bpf: Provide helper to do forwarding lookups in kernel FIB table") Signed-off-by: Martynas Pumputis <m@lambda.lt> Acked-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--include/uapi/linux/bpf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 929c8e537a14..0aa05f316741 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -3104,8 +3104,8 @@ struct bpf_raw_tracepoint_args {
/* DIRECT: Skip the FIB rules and go to FIB table associated with device
* OUTPUT: Do lookup from egress perspective; default is ingress
*/
-#define BPF_FIB_LOOKUP_DIRECT BIT(0)
-#define BPF_FIB_LOOKUP_OUTPUT BIT(1)
+#define BPF_FIB_LOOKUP_DIRECT (1U << 0)
+#define BPF_FIB_LOOKUP_OUTPUT (1U << 1)
enum {
BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */