]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Preserve PKT_ALLOC flag inside PACKET_RECYCLE().
authorKen Steele <ken@tilera.com>
Tue, 14 May 2013 19:38:00 +0000 (15:38 -0400)
committerVictor Julien <victor@inliniac.net>
Wed, 15 May 2013 10:30:16 +0000 (12:30 +0200)
The PKT_ALLOC flag was being cleared by PACKET_RECYCLE(), which could
then result in a packet being pushed back to the Packet ring buffer
incorrectly.

src/decode.h

index 446bdf6f7d25e9c029463efec06719b1e19e998f..a8b38e0e716e22ef59aaa532d71247ff0b1a0341 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2012 Open Information Security Foundation
+/* Copyright (C) 2007-2013 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -639,7 +639,7 @@ typedef struct DecodeThreadVars_
         (p)->dp = 0;                            \
         (p)->proto = 0;                         \
         (p)->recursion_level = 0;               \
-        (p)->flags = 0;                         \
+        (p)->flags = (p)->flags & PKT_ALLOC;    \
         (p)->flowflags = 0;                     \
         (p)->pkt_src = 0;                       \
         FlowDeReference(&((p)->flow));          \