]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
lib/test_bpf: Fix JMP_JSET tests
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tue, 5 Apr 2016 10:02:53 +0000 (15:32 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Apr 2016 20:47:50 +0000 (16:47 -0400)
JMP_JSET tests incorrectly used BPF_JNE. Fix the same.

Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/test_bpf.c

index 27a7a26b1ece2e145296b144096191ffa6af504e..e76fa4d224d8d7ddf8fa627ca717268d9fa4057a 100644 (file)
@@ -4303,7 +4303,7 @@ static struct bpf_test tests[] = {
                .u.insns_int = {
                        BPF_ALU32_IMM(BPF_MOV, R0, 0),
                        BPF_LD_IMM64(R1, 3),
-                       BPF_JMP_IMM(BPF_JNE, R1, 2, 1),
+                       BPF_JMP_IMM(BPF_JSET, R1, 2, 1),
                        BPF_EXIT_INSN(),
                        BPF_ALU32_IMM(BPF_MOV, R0, 1),
                        BPF_EXIT_INSN(),
@@ -4317,7 +4317,7 @@ static struct bpf_test tests[] = {
                .u.insns_int = {
                        BPF_ALU32_IMM(BPF_MOV, R0, 0),
                        BPF_LD_IMM64(R1, 3),
-                       BPF_JMP_IMM(BPF_JNE, R1, 0xffffffff, 1),
+                       BPF_JMP_IMM(BPF_JSET, R1, 0xffffffff, 1),
                        BPF_EXIT_INSN(),
                        BPF_ALU32_IMM(BPF_MOV, R0, 1),
                        BPF_EXIT_INSN(),
@@ -4474,7 +4474,7 @@ static struct bpf_test tests[] = {
                        BPF_ALU32_IMM(BPF_MOV, R0, 0),
                        BPF_LD_IMM64(R1, 3),
                        BPF_LD_IMM64(R2, 2),
-                       BPF_JMP_REG(BPF_JNE, R1, R2, 1),
+                       BPF_JMP_REG(BPF_JSET, R1, R2, 1),
                        BPF_EXIT_INSN(),
                        BPF_ALU32_IMM(BPF_MOV, R0, 1),
                        BPF_EXIT_INSN(),
@@ -4489,7 +4489,7 @@ static struct bpf_test tests[] = {
                        BPF_ALU32_IMM(BPF_MOV, R0, 0),
                        BPF_LD_IMM64(R1, 3),
                        BPF_LD_IMM64(R2, 0xffffffff),
-                       BPF_JMP_REG(BPF_JNE, R1, R2, 1),
+                       BPF_JMP_REG(BPF_JSET, R1, R2, 1),
                        BPF_EXIT_INSN(),
                        BPF_ALU32_IMM(BPF_MOV, R0, 1),
                        BPF_EXIT_INSN(),