]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode: remove pseudo packet checks
authorVictor Julien <victor@inliniac.net>
Mon, 11 Nov 2019 10:59:35 +0000 (11:59 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 7 Feb 2020 14:43:10 +0000 (15:43 +0100)
Bug 1107 checks/hacks should not longer be needed, so remove them.

src/source-af-packet.c
src/source-erf-dag.c
src/source-erf-file.c
src/source-ipfw.c
src/source-napatech.c
src/source-netmap.c
src/source-nfq.c
src/source-pcap-file.c
src/source-pcap.c
src/source-pfring.c
src/source-windivert.c

index f327261597be7ae144362200c401f44a0432a1d9..98657ab21fcb0ab21b86b4d3cb56281e64a800f9 100644 (file)
@@ -2887,10 +2887,7 @@ TmEcode DecodeAFP(ThreadVars *tv, Packet *p, void *data)
     SCEnter();
     DecodeThreadVars *dtv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     /* update counters */
     DecodeUpdatePacketCounters(tv, dtv, p);
index 554de64e1e46c00117d302e72096981b5ea83a81..c8573a57f60b1030f8cd2c62e8eadc87938719aa 100644 (file)
@@ -612,10 +612,7 @@ DecodeErfDag(ThreadVars *tv, Packet *p, void *data)
     SCEnter();
     DecodeThreadVars *dtv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     /* update counters */
     DecodeUpdatePacketCounters(tv, dtv, p);
index bab7b2652fc7282511e8fbecdd3ca93c175e0c39..1de5bb5f7ff008c8059769ccc8bcf000266d4396 100644 (file)
@@ -280,10 +280,7 @@ DecodeErfFile(ThreadVars *tv, Packet *p, void *data)
     SCEnter();
     DecodeThreadVars *dtv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     /* Update counters. */
     DecodeUpdatePacketCounters(tv, dtv, p);
index 6110e5e0e0736b089f500d910e2250f52504a140..0828e4a0203c289a34fea89d7274ab42baa6293d 100644 (file)
@@ -445,10 +445,7 @@ TmEcode DecodeIPFW(ThreadVars *tv, Packet *p, void *data)
 
     SCEnter();
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     /* update counters */
     DecodeUpdatePacketCounters(tv, dtv, p);
index 3bb23c69e435a2ffd17a77230a1a1e9221e5fbf7..3f719794a8de48abb066917ed4cd48bdc019673f 100644 (file)
@@ -546,10 +546,7 @@ TmEcode NapatechDecode(ThreadVars *tv, Packet *p, void *data)
 
     DecodeThreadVars *dtv = (DecodeThreadVars *) data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     // update counters
     DecodeUpdatePacketCounters(tv, dtv, p);
index 9258fdb7070b04ee31ed938f610c8cf155f6a273..c7f67c10daf183281ec95319a53c1963f39daf83 100644 (file)
@@ -745,10 +745,7 @@ static TmEcode DecodeNetmap(ThreadVars *tv, Packet *p, void *data)
 
     DecodeThreadVars *dtv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        SCReturnInt(TM_ECODE_OK);
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     /* update counters */
     DecodeUpdatePacketCounters(tv, dtv, p);
index a783e03303721eeb4d846f9a44ab7d0bfaf1d02d..fbfbf371d953d42bfc8df2b5de148e1f85b1b993 100644 (file)
@@ -1231,10 +1231,7 @@ TmEcode DecodeNFQ(ThreadVars *tv, Packet *p, void *data)
     IPV6Hdr *ip6h = (IPV6Hdr *)GET_PKT_DATA(p);
     DecodeThreadVars *dtv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (PKT_IS_PSEUDOPKT(p))
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     DecodeUpdatePacketCounters(tv, dtv, p);
 
index 63fe5b4760840ec4139afd59d8df0f62a1a0cbf3..b811d4e3a187a06559d4432ea92980b7db4821f9 100644 (file)
@@ -394,10 +394,7 @@ static TmEcode DecodePcapFile(ThreadVars *tv, Packet *p, void *data)
     SCEnter();
     DecodeThreadVars *dtv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     /* update counters */
     DecodeUpdatePacketCounters(tv, dtv, p);
index 0870ec62fe50e2676de01bce4ede00d70964af14..ee23429c5ba7ad106ee5fc7e49d17f6fd8193eeb 100644 (file)
@@ -545,10 +545,7 @@ static TmEcode DecodePcap(ThreadVars *tv, Packet *p, void *data)
     SCEnter();
     DecodeThreadVars *dtv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     /* update counters */
     DecodeUpdatePacketCounters(tv, dtv, p);
index a07ab14c19d2a1b66e4f438d9587cf5a08bbf1e5..a21674037d35c754f221c8a44ebc6bada96cf18e 100644 (file)
@@ -722,10 +722,7 @@ TmEcode DecodePfring(ThreadVars *tv, Packet *p, void *data)
 {
     DecodeThreadVars *dtv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug: https://redmine.openinfosecfoundation.org/issues/1107 */
-    if (p->flags & PKT_PSEUDO_STREAM_END)
-        return TM_ECODE_OK;
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     /* update counters */
     DecodeUpdatePacketCounters(tv, dtv, p);
index bcf37c60543f627b3b2c419356d7f41c32d7a9db..3701310d720ad0ed7dd9ed4f90229ae95e2c86df 100644 (file)
@@ -863,12 +863,7 @@ TmEcode DecodeWinDivert(ThreadVars *tv, Packet *p, void *data)
     IPV6Hdr *ip6h = (IPV6Hdr *)GET_PKT_DATA(p);
     DecodeThreadVars *d_tv = (DecodeThreadVars *)data;
 
-    /* XXX HACK: flow timeout can call us for injected pseudo packets
-     *           see bug:
-     * https://redmine.openinfosecfoundation.org/issues/1107
-     */
-    if (PKT_IS_PSEUDOPKT(p))
-        SCReturnInt(TM_ECODE_OK);
+    BUG_ON(PKT_IS_PSEUDOPKT(p));
 
     DecodeUpdatePacketCounters(tv, d_tv, p);