]> The Tcpdump Group git mirrors - libpcap/commit
Improve handling of DLT_PFLOG when generating filter code.
authorGuy Harris <[email protected]>
Sun, 30 Jan 2022 05:11:34 +0000 (21:11 -0800)
committerGuy Harris <[email protected]>
Sun, 20 Feb 2022 23:56:48 +0000 (15:56 -0800)
commit34e569b46777133e3adbff4355c5ebf5540d33f5
tree5aa3dab5c4c3987951205b2ae8aaa6e3ec3d5b1e
parent7a84edcfce3f97d9e06a7114464dcadb02d12478
Improve handling of DLT_PFLOG when generating filter code.

Don't rely on the OS's pflog include files to give the pflog header
length; instead, fetch it from the length field of the header, and round
up to a multiple of 4.  That way, it'll handle headers for OSes other
than the one for which we're compiling code, and will handle different
header lengths for any given OS if, for example, a new version of the OS
adds more fields to the end.

Don't rely on the OS's pflog include files to define direction types,
reason types, action types, or the layout of the header; instead, define
them ourselves in a header of our own, with #ifs to select the ones that
are only on some platforms.  That way, it'll handle some fields and
field values (the ones common to all OSes with pflog) on all OSes, even
ones without pflog.

This should also clean up the FreeBSD build issues reported in #1074, as
we no longer include <net/if_pflog.h>.

(cherry picked from commit 2757ddca53c330c2ba7315e993029b090e8dcb85)
CMakeLists.txt
Makefile.in
config.h.in
configure
configure.ac
gencode.c
grammar.y.in