Skip to content

Commit b1d6c15

Browse files
brbborkmann
authored andcommitted
bpf: simplify definition of BPF_FIB_LOOKUP related flags
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: 87f5fc7 ("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>
1 parent 01d76b5 commit b1d6c15

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/uapi/linux/bpf.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,8 +3378,8 @@ struct bpf_raw_tracepoint_args {
33783378
/* DIRECT: Skip the FIB rules and go to FIB table associated with device
33793379
* OUTPUT: Do lookup from egress perspective; default is ingress
33803380
*/
3381-
#define BPF_FIB_LOOKUP_DIRECT BIT(0)
3382-
#define BPF_FIB_LOOKUP_OUTPUT BIT(1)
3381+
#define BPF_FIB_LOOKUP_DIRECT (1U << 0)
3382+
#define BPF_FIB_LOOKUP_OUTPUT (1U << 1)
33833383

33843384
enum {
33853385
BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */

0 commit comments

Comments
 (0)