diff options
Diffstat (limited to 'tools/regression/bpf/bpf_filter/tests/test0077.h')
-rw-r--r-- | tools/regression/bpf/bpf_filter/tests/test0077.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/regression/bpf/bpf_filter/tests/test0077.h b/tools/regression/bpf/bpf_filter/tests/test0077.h new file mode 100644 index 0000000..c4224c1 --- /dev/null +++ b/tools/regression/bpf/bpf_filter/tests/test0077.h @@ -0,0 +1,36 @@ +/*- + * Test 0077: Check boundary conditions (BPF_ST) + * + * $FreeBSD$ + */ + +/* BPF program */ +struct bpf_insn pc[] = { + BPF_STMT(BPF_LD|BPF_IMM, 0xdeadc0de), + BPF_STMT(BPF_ST, 0xffffffff), + BPF_STMT(BPF_RET+BPF_A, 0), +}; + +/* Packet */ +u_char pkt[] = { + 0x00, +}; + +/* Packet length seen on wire */ +u_int wirelen = sizeof(pkt); + +/* Packet length passed on buffer */ +u_int buflen = sizeof(pkt); + +/* Invalid instruction */ +int invalid = 1; + +/* Expected return value */ +u_int expect = 0xdeadc0de; + +/* Expeced signal */ +#ifdef BPF_JIT_COMPILER +int expect_signal = SIGSEGV; +#else +int expect_signal = SIGBUS; +#endif |