tcpdump mailing list archives

Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle


From: Denis Ovsienko <denis () ovsienko info>
Date: Mon, 7 Jul 2025 11:29:13 +0100

On Fri, 4 Jul 2025 13:05:01 -0700
Guy Harris <gharris () sonic net> wrote:

The underlying problem is that we have a compiler with multiple
targets, and the target is indicated by a pcap_t *.

My inclination might be to have a version of pcap_compile() that
takes, as additional arguments, a link-layer type, a snapshot, and a
set of BPF_SPECIAL_ flags.
[...]

Yes, and that version could be the same old pcap_compile() if the
pcap_t contained the compilation style requests, as it already contains
the link-layer type and the snapshot.  Something like this:

// This would be PCAP_TARGET_AUTO by default.
pcap_setopt(handle, PCAP_COMPILE_TARGET, PCAP_LINUX_WITH_VLAN);

pcap_compile(handle, fp, "tcp port 80", 1, PCAP_NETMASK_UNKNOWN);

-- 
    Denis Ovsienko
_______________________________________________
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: