]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: micro optimization
authorEric Leblond <eric@regit.org>
Wed, 10 Oct 2018 17:26:29 +0000 (19:26 +0200)
committerEric Leblond <eric@regit.org>
Mon, 3 Dec 2018 16:46:33 +0000 (17:46 +0100)
Use a else if instead of two chained if constructs.

src/source-af-packet.c

index 9c7520ba37465dc5ea71d13fd52f466017123a0a..389917bfda17db5411822eab3f5adb9a0ab3276b 100644 (file)
@@ -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;