tcpdump mailing list archives
Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle
From: Bill Fenner <fenner () gmail com>
Date: Fri, 4 Jul 2025 11:55:52 -0400
Hi all, I have a little program that basically calls pcap_open_dead(), pcap_compile(), and then dumps the instructions like a C struct, so that we can include a bpf program in some other code that will use it later. (Like "tcpdump -dd", but with a little extra formatting.) We may know that we will be using this code on a kernel that requires BPF_SPECIAL_VLAN_HANDLING, and so I'd like to be able to set that flag on a "dead" handle. Obviously, the current mechanism is to test this dynamically when the handle is live. Does anyone have any opinions about how to implement this, through the generic pcap interface? I can think of two possibilities: 1. implement set_special_vlan_handling_op, and have it implemented by dead and linux, and have the default version return an error 2. implement set_bpf_codegen_flags_op, and have a generic implementation, assuming that the caller completely knows what they are doing. Then move the definition of BPF_SPECIAL_VLAN_HANDLING from pcap-int.h to the public header. Anyone have a preference of which one I should go with, and/or have a better suggestion? Thanks, Bill _______________________________________________ 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:
- Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Bill Fenner (Jul 04)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Guy Harris (Jul 04)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Denis Ovsienko (Jul 07)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Guy Harris (Jul 07)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Denis Ovsienko (Jul 08)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Guy Harris (Jul 08)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Denis Ovsienko (Jul 07)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Guy Harris (Jul 04)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Stephen Hemminger via tcpdump-workers (Jul 08)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Guy Harris (Jul 04)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Michael Richardson (Jul 04)
- Re: Setting BPF_SPECIAL_VLAN_HANDLING on a "dead" handle Denis Ovsienko (Jul 07)