bpf: simplify definition of BPF_FIB_LOOKUP related flags
authorMartynas Pumputis <m@lambda.lt>
Wed, 12 Jun 2019 16:05:40 +0000 (18:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2019 11:14:48 +0000 (13:14 +0200)
commit5e558f9a6d7bc5dcdd33a0980777078894670fd5
tree3b944fc761f895e0d7d6f34ad6a5c77fcf9468cc
parent7d2c0ec20cb207caac46bc9857573e453792fbdd
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>
include/uapi/linux/bpf.h