diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2016-11-26 01:28:04 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-27 20:38:47 -0500 |
commit | 88575199cc65de99a156888629a68180c830eff2 (patch) | |
tree | 813b5da46b6d10f916bccc2f408dd689c613eeb3 /include | |
parent | e3739099270b238630368b1d8f547c1bb31ba6ad (diff) | |
download | linux-stable-88575199cc65de99a156888629a68180c830eff2.tar.gz linux-stable-88575199cc65de99a156888629a68180c830eff2.tar.bz2 linux-stable-88575199cc65de99a156888629a68180c830eff2.zip |
bpf: drop unnecessary context cast from BPF_PROG_RUN
Since long already bpf_func is not only about struct sk_buff * as
input anymore. Make it generic as void *, so that callers don't
need to cast for it each time they call BPF_PROG_RUN().
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')
-rw-r--r-- | include/linux/filter.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index 1f09c521adfe..7f246a281435 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -408,8 +408,8 @@ struct bpf_prog { enum bpf_prog_type type; /* Type of BPF program */ struct bpf_prog_aux *aux; /* Auxiliary fields */ struct sock_fprog_kern *orig_prog; /* Original BPF program */ - unsigned int (*bpf_func)(const struct sk_buff *skb, - const struct bpf_insn *filter); + unsigned int (*bpf_func)(const void *ctx, + const struct bpf_insn *insn); /* Instructions for interpreter */ union { struct sock_filter insns[0]; @@ -504,7 +504,7 @@ static inline u32 bpf_prog_run_xdp(const struct bpf_prog *prog, u32 ret; rcu_read_lock(); - ret = BPF_PROG_RUN(prog, (void *)xdp); + ret = BPF_PROG_RUN(prog, xdp); rcu_read_unlock(); return ret; |