af_packet: Fixed compatibility for kernel versions < 3.14.

This commit is contained in:
Jan Grashoefer 2016-12-06 03:31:10 +01:00 committed by Tim Wojtulewicz
parent 742b0820bc
commit 478265b4f2
2 changed files with 5 additions and 2 deletions

View file

@ -180,7 +180,9 @@ inline uint32_t AF_PacketSource::GetFanoutMode()
{
switch ( BifConst::AF_Packet::fanout_mode->AsEnum() ) {
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;
#endif
default: return PACKET_FANOUT_HASH;
}
}

View file

@ -8,8 +8,9 @@ extern "C" {
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <errno.h> // errorno
#include <unistd.h> // close()
#include <errno.h> // errorno
#include <unistd.h> // close()
#include <linux/version.h> // kernel version
#include <net/ethernet.h> // ETH_P_ALL
#include <linux/if.h> // ifreq