zeek / cmake

CMake scripts used in Zeek
https://www.zeek.org
Other
48 stars 59 forks source link

Set DONT_HAVE_LIBPCAP_DLT_LINUX_SLL2 if libpcap doesn't have LINUX_SLL2 support #48

Closed simeonmiteff closed 2 years ago

simeonmiteff commented 2 years ago

DLT_LINUX_SLL and DLT_LINUX_SLL2 are libpcap link-types for fake link-layer headers used when capturing packets on Linux with PF_PACKET (which happens if you run tcpdump -i any).

The difference between the versions is a slightly modified header/struct and link-type number. Zeek currently understands version 1. I'm working on https://github.com/zeek/zeek/pull/2340 which adds support for reading version 2 PCAP files.

Libpcap only added DLT_LINUX_SLL2 support in version 1.10.0.

On @timwoj's suggestion, this PR has DONT_HAVE_LIBPCAP_DLT_LINUX_SLL2 set by cmake allows for conditionally compiling in a check/abort when trying to read this type of file with an older libpcap (i.e., Ubuntu <= 18, Debian <= 10, Centos <= 7). The btest case added in https://github.com/zeek/zeek/pull/2340 also tests for DONT_HAVE_LIBPCAP_DLT_LINUX_SLL2 in zeek-config.h and skips the test on those platforms.