diff options
author | jkim <jkim@FreeBSD.org> | 2008-08-25 21:33:12 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2008-08-25 21:33:12 +0000 |
commit | dddb7ff15181e75b4bd2a8035f91237e1abce952 (patch) | |
tree | 07dcff81836c2dae5a55f0c76c48bab5fe8640f9 | |
parent | e21d933237c7a4114d09235bc66c66c6d084c818 (diff) | |
download | FreeBSD-src-dddb7ff15181e75b4bd2a8035f91237e1abce952.zip FreeBSD-src-dddb7ff15181e75b4bd2a8035f91237e1abce952.tar.gz |
Reflect sys/net/bpf_jitter.h changes to regression test.
-rw-r--r-- | tools/regression/bpf/bpf_filter/bpf_test.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/tools/regression/bpf/bpf_filter/bpf_test.c b/tools/regression/bpf/bpf_filter/bpf_test.c index 4412728..aa70370 100644 --- a/tools/regression/bpf/bpf_filter/bpf_test.c +++ b/tools/regression/bpf/bpf_filter/bpf_test.c @@ -67,30 +67,20 @@ bpf_compile_and_filter(void) if (nins == 0) return (0); - /* Allocate the filter's memory */ - if ((filter.mem = (int *)malloc(BPF_MEMWORDS * sizeof(int))) == NULL) - goto fail; - /* Create the binary */ - if ((filter.func = bpf_jit_compile(pc, nins, filter.mem)) == NULL) - goto fail; + if ((filter.func = bpf_jit_compile(pc, nins, filter.mem)) == NULL) { + if (verbose > 1) + printf("Failed to allocate memory:\t"); + if (verbose > 0) + printf("FATAL\n"); + exit(FATAL); + } ret = (*(filter.func))(pkt, wirelen, buflen); - free(filter.mem); free(filter.func); return (ret); - -fail: - if (filter.mem != NULL) - free(filter.mem); - - if (verbose > 1) - printf("Failed to allocate memory:\t"); - if (verbose > 0) - printf("FATAL\n"); - exit(FATAL); } #else |