mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
af_packet: Fixed compatibility for kernel versions < 3.14.
This commit is contained in:
parent
742b0820bc
commit
478265b4f2
2 changed files with 5 additions and 2 deletions
|
@ -180,7 +180,9 @@ inline uint32_t AF_PacketSource::GetFanoutMode()
|
||||||
{
|
{
|
||||||
switch ( BifConst::AF_Packet::fanout_mode->AsEnum() ) {
|
switch ( BifConst::AF_Packet::fanout_mode->AsEnum() ) {
|
||||||
case BifEnum::AF_Packet::FANOUT_CPU: return PACKET_FANOUT_CPU;
|
case BifEnum::AF_Packet::FANOUT_CPU: return PACKET_FANOUT_CPU;
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
|
||||||
case BifEnum::AF_Packet::FANOUT_QM: return PACKET_FANOUT_QM;
|
case BifEnum::AF_Packet::FANOUT_QM: return PACKET_FANOUT_QM;
|
||||||
|
#endif
|
||||||
default: return PACKET_FANOUT_HASH;
|
default: return PACKET_FANOUT_HASH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,9 @@ extern "C" {
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
#include <errno.h> // errorno
|
#include <errno.h> // errorno
|
||||||
#include <unistd.h> // close()
|
#include <unistd.h> // close()
|
||||||
|
#include <linux/version.h> // kernel version
|
||||||
|
|
||||||
#include <net/ethernet.h> // ETH_P_ALL
|
#include <net/ethernet.h> // ETH_P_ALL
|
||||||
#include <linux/if.h> // ifreq
|
#include <linux/if.h> // ifreq
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue