bpf: Replace hard-coded 0 with BPF_K in check_alu_op
Enhance readability a bit. Signed-off-by: Simon Wang <wangchuanguo@inspur.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20220622031923.65692-1-wangchuanguo@inspur.com
This commit is contained in:
parent
6dc7a0baf1
commit
395e942d34
@ -9096,7 +9096,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
|
||||
|
||||
if (opcode == BPF_END || opcode == BPF_NEG) {
|
||||
if (opcode == BPF_NEG) {
|
||||
if (BPF_SRC(insn->code) != 0 ||
|
||||
if (BPF_SRC(insn->code) != BPF_K ||
|
||||
insn->src_reg != BPF_REG_0 ||
|
||||
insn->off != 0 || insn->imm != 0) {
|
||||
verbose(env, "BPF_NEG uses reserved fields\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user