diff --git a/src/source-af-packet.c b/src/source-af-packet.c index db6b906268..c6c46ae44f 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -174,11 +174,11 @@ TmEcode NoAFPSupportExit(ThreadVars *tv, const void *initdata, void **data) #ifndef TP_STATUS_USER_BUSY /* for new use latest bit available in tp_status */ -#define TP_STATUS_USER_BUSY (1 << 31) +#define TP_STATUS_USER_BUSY BIT_U32(31) #endif #ifndef TP_STATUS_VLAN_VALID -#define TP_STATUS_VLAN_VALID (1 << 4) +#define TP_STATUS_VLAN_VALID BIT_U32(4) #endif enum { @@ -1989,7 +1989,7 @@ int AFPIsFanoutSupported(int cluster_id) if (fd < 0) return 0; - uint16_t mode = PACKET_FANOUT_HASH | PACKET_FANOUT_FLAG_DEFRAG; + uint32_t mode = PACKET_FANOUT_HASH | PACKET_FANOUT_FLAG_DEFRAG; uint16_t id = 1; uint32_t option = (mode << 16) | (id & 0xffff); int r = setsockopt(fd, SOL_PACKET, PACKET_FANOUT,(void *)&option, sizeof(option)); @@ -2158,7 +2158,7 @@ static int AFPCreateSocket(AFPThreadVars *ptv, char *devname, int verbose) #ifdef HAVE_PACKET_FANOUT /* add binded socket to fanout group */ if (ptv->threads > 1) { - uint16_t mode = ptv->cluster_type; + uint32_t mode = ptv->cluster_type; uint16_t id = ptv->cluster_id; uint32_t option = (mode << 16) | (id & 0xffff); r = setsockopt(ptv->socket, SOL_PACKET, PACKET_FANOUT,(void *)&option, sizeof(option));