tcpdump mailing list archives

Re: bpf_dump.c


From: Francois-Xavier Le Bail via tcpdump-workers <tcpdump-workers () lists tcpdump org>
Date: Wed, 12 Feb 2025 22:54:18 +0100

--- Begin Message --- From: Francois-Xavier Le Bail <devel.fx.lebail () orange fr>
Date: Wed, 12 Feb 2025 22:54:18 +0100
On 09/02/2025 14:22, Denis Ovsienko via tcpdump-workers wrote:
Hello all.

tcpdump has been keeping a copy of bpf_dump.c from libpcap with the
following description in INSTALL.md:

"bpf_dump.c   - BPF program printing routines, in case libpcap
doesn't have them. A known example is OpenBSD libpcap."

Indeed, OpenBSD libpcap still does not have bpf_dump().  However, in
the master branch tcpdump(1) says:

"This version of tcpdump requires libpcap 1.0 or later."

bpf_dump() has been in libpcap since version 0.6.1, so according to the
above any supported version of libpcap has bpf_dump().

This way, either bpf_dump.c should be removed from tcpdump to match the
stated version requirement (which would exclude OpenBSD libpcap) or the
version requirement should be worded differently.  Alternatively,
someone could add bpf_dump() to OpenBSD libpcap, which would simplify
OpenBSD tcpdump as well, because it includes a copy of bpf_dump.c too.

They are also different:

$ diff bpf_dump.c ../libpcap/bpf_dump.c                                         
24,25c24
< #include "netdissect-stdinc.h"
< 
---
#include <pcap.h>
28,29c27
< #include "netdissect.h"
< #include "interface.h"
---
#include "optimize.h"
34c32
<       struct bpf_insn *insn;
---
      const struct bpf_insn *insn;
55,56c53,56
<               extern int bids[];
<               printf(bids[i] > 0 ? "[%02d]" : " -- ", bids[i] - 1);
---
              if (i < NBIDS && bids[i] > 0)
                      printf("[%02d]", bids[i] - 1);
              else
                      printf(" -- ");


--- End Message ---
_______________________________________________
tcpdump-workers mailing list -- tcpdump-workers () lists tcpdump org
To unsubscribe send an email to tcpdump-workers-leave () lists tcpdump org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Current thread: