diff options
Diffstat (limited to 'tools/regression/bpf/bpf_filter/bpf_test.c')
-rw-r--r-- | tools/regression/bpf/bpf_filter/bpf_test.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/tools/regression/bpf/bpf_filter/bpf_test.c b/tools/regression/bpf/bpf_filter/bpf_test.c index 94e7d7d..40b5af5 100644 --- a/tools/regression/bpf/bpf_filter/bpf_test.c +++ b/tools/regression/bpf/bpf_filter/bpf_test.c @@ -52,10 +52,7 @@ __FBSDID("$FreeBSD$"); static void sig_handler(int); -#if defined(BPF_JIT_COMPILER) || defined(BPF_VALIDATE) static int nins = sizeof(pc) / sizeof(pc[0]); -#endif - static int verbose = LOG_LEVEL; #ifdef BPF_JIT_COMPILER @@ -68,10 +65,6 @@ bpf_compile_and_filter(void) bpf_jit_filter *filter; u_int i, ret; - /* Do not use BPF JIT compiler for an empty program */ - if (nins == 0) - return (0); - /* Compile the BPF filter program and generate native code. */ if ((filter = bpf_jitter(pc, nins)) == NULL) { if (verbose > 1) @@ -263,7 +256,7 @@ main(void) ret = bpf_compile_and_filter(); #else for (i = 0; i < BPF_NRUNS; i++) - ret = bpf_filter(pc, pkt, wirelen, buflen); + ret = bpf_filter(nins != 0 ? pc : NULL, pkt, wirelen, buflen); #endif if (ret != expect) { if (verbose > 1) |