summaryrefslogtreecommitdiff
path: root/bpf_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'bpf_dump.c')
-rw-r--r--bpf_dump.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/bpf_dump.c b/bpf_dump.c
index 5eaadc0..a9c9116 100644
--- a/bpf_dump.c
+++ b/bpf_dump.c
@@ -20,12 +20,14 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <pcap.h>
#include <stdio.h>
+#include "optimize.h"
+
void
bpf_dump(const struct bpf_program *p, int option)
{
@@ -50,8 +52,10 @@ bpf_dump(const struct bpf_program *p, int option)
}
for (i = 0; i < n; ++insn, ++i) {
#ifdef BDEBUG
- extern int bids[];
- printf(bids[i] > 0 ? "[%02d]" : " -- ", bids[i] - 1);
+ if (i < NBIDS && bids[i] > 0)
+ printf("[%02d]", bids[i] - 1);
+ else
+ printf(" -- ");
#endif
puts(bpf_image(insn, i));
}