From: Eric Leblond Date: Wed, 10 Oct 2018 17:26:29 +0000 (+0200) Subject: af-packet: micro optimization X-Git-Tag: suricata-4.1.1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e98b5e4946a0eb7bb4938b96c99b975107b77168;p=thirdparty%2Fsuricata.git af-packet: micro optimization Use a else if instead of two chained if constructs. --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index 9c7520ba37..389917bfda 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -1058,8 +1058,7 @@ static inline int AFPParsePacketV3(AFPThreadVars *ptv, struct tpacket_block_desc p->afp_v.v4_map_fd = ptv->v4_map_fd; p->afp_v.v6_map_fd = ptv->v6_map_fd; #endif - } - if (ptv->flags & AFP_XDPBYPASS) { + } else if (ptv->flags & AFP_XDPBYPASS) { p->BypassPacketsFlow = AFPXDPBypassCallback; #ifdef HAVE_PACKET_EBPF p->afp_v.v4_map_fd = ptv->v4_map_fd;