]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
af-packet: fix parsing packet in TPACKET_V3 mode
authorAlexander Gozman <a.gozman@securitycode.ru>
Mon, 20 Feb 2017 13:47:31 +0000 (16:47 +0300)
committerVictor Julien <victor@inliniac.net>
Tue, 21 Feb 2017 08:57:09 +0000 (09:57 +0100)
AFPParsePacketV3() saved tpacket_block_desc structure
instead of tpacket3_hdr. As a result, reconstructed
packets were wrong.

Bug #2044.

src/source-af-packet.c

index 7e981ba24285bf465d90103940a6f1aeee170d2f..1e25d316bb343b14ad6ba4b081cc1db82cf0df76 100644 (file)
@@ -992,7 +992,7 @@ static inline int AFPParsePacketV3(AFPThreadVars *ptv, struct tpacket_block_desc
             TmqhOutputPacketpool(ptv->tv, p);
             SCReturnInt(AFP_FAILURE);
         }
-        p->afp_v.relptr = pbd;
+        p->afp_v.relptr = ppd;
         p->ReleasePacket = AFPReleasePacketV3;
         p->afp_v.mpeer = ptv->mpeer;
         AFPRefSocket(ptv->mpeer);