From d9d7b76c5df7ba063270a9431ad40672c04f109f Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 22 Feb 2023 12:15:44 +0100 Subject: [PATCH] af_packet: Add guarded zeek/zeek-version.h include. With zeek/zeek#2802, zeek-config.h will not provide ZEEK_VERSION_NUMBER when a plugin is compiled as a builtin/static plugin into Zeek. This is done to avoid tree-wide ccache busting when just the version changes. --- src/iosource/af_packet/src/AF_Packet.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/iosource/af_packet/src/AF_Packet.cc b/src/iosource/af_packet/src/AF_Packet.cc index 387c1da646..ad27e8e9f4 100644 --- a/src/iosource/af_packet/src/AF_Packet.cc +++ b/src/iosource/af_packet/src/AF_Packet.cc @@ -1,5 +1,12 @@ #include "zeek/zeek-config.h" +// Starting with Zeek 6.0, zeek-config.h does not provide the +// ZEEK_VERSION_NUMBER macro anymore when compiling a included +// plugin. Use the new zeek/zeek-version.h header if it exists. +#if __has_include("zeek/zeek-version.h") +#include "zeek/zeek-version.h" +#endif + #include "AF_Packet.h" #include "RX_Ring.h"