]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Refine bpf_dump(). [skip appveyor]
authorDenis Ovsienko <[email protected]>
Thu, 13 Feb 2025 01:23:24 +0000 (01:23 +0000)
committerDenis Ovsienko <[email protected]>
Thu, 13 Feb 2025 01:34:23 +0000 (01:34 +0000)
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.

bpf_dump.c

index da50c3e2dd1c88b67c5ef57da539175a2e7b3b87..2a55cf87b1c7b42120b641330c9e42ffa6f2387f 100644 (file)
@@ -31,7 +31,7 @@
 void
 bpf_dump(const struct bpf_program *p, int option)
 {
-       struct bpf_insn *insn;
+       const struct bpf_insn *insn;
        int i;
        int n = p->bf_len;
 
@@ -51,10 +51,6 @@ bpf_dump(const struct bpf_program *p, int option)
                return;
        }
        for (i = 0; i < n; ++insn, ++i) {
-#ifdef BDEBUG
-               extern int bids[];
-               printf(bids[i] > 0 ? "[%02d]" : " -- ", bids[i] - 1);
-#endif
                puts(bpf_image(insn, i));
        }
 }