1 /*- 2 * Test 0075: Check boundary conditions (BPF_LD+BPF_MEM) 3 * 4 * $FreeBSD$ 5 */ 6 7 /* BPF program */ 8 static struct bpf_insn pc[] = { 9 BPF_STMT(BPF_LD+BPF_IMM, 0xdeadc0de), 10 BPF_STMT(BPF_LD+BPF_MEM, 0x8fffffff), 11 BPF_STMT(BPF_RET+BPF_A, 0), 12 }; 13 14 /* Packet */ 15 static u_char pkt[] = { 16 0x00, 17 }; 18 19 /* Packet length seen on wire */ 20 static u_int wirelen = sizeof(pkt); 21 22 /* Packet length passed on buffer */ 23 static u_int buflen = sizeof(pkt); 24 25 /* Invalid instruction */ 26 static int invalid = 1; 27 28 /* Expected return value */ 29 static u_int expect = 0xdeadc0de; 30 31 /* Expected signal */ 32 #ifdef __amd64__ 33 static int expect_signal = SIGBUS; 34 #else 35 static int expect_signal = SIGSEGV; 36 #endif 37