Skip to content

Commit 5c010db

Browse files
committed
Refine bpf_dump(). [skip appveyor]
Constify the temporary pointer, as was done in libpcap in 2008. Remove the BDEBUG conditional block becase in libpcap that is a part of the optimizer debug feature, but in tcpdump it is dead code.
1 parent f27d16e commit 5c010db

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

bpf_dump.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
void
3232
bpf_dump(const struct bpf_program *p, int option)
3333
{
34-
struct bpf_insn *insn;
34+
const struct bpf_insn *insn;
3535
int i;
3636
int n = p->bf_len;
3737

@@ -51,10 +51,6 @@ bpf_dump(const struct bpf_program *p, int option)
5151
return;
5252
}
5353
for (i = 0; i < n; ++insn, ++i) {
54-
#ifdef BDEBUG
55-
extern int bids[];
56-
printf(bids[i] > 0 ? "[%02d]" : " -- ", bids[i] - 1);
57-
#endif
5854
puts(bpf_image(insn, i));
5955
}
6056
}

0 commit comments

Comments
 (0)