From: Victor Julien Date: Mon, 11 Nov 2019 10:59:35 +0000 (+0100) Subject: decode: remove pseudo packet checks X-Git-Tag: suricata-6.0.0-beta1~777 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7810f22413812d60e9503846aa1a5eebdb86c552;p=thirdparty%2Fsuricata.git decode: remove pseudo packet checks Bug 1107 checks/hacks should not longer be needed, so remove them. --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index f327261597..98657ab21f 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -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); diff --git a/src/source-erf-dag.c b/src/source-erf-dag.c index 554de64e1e..c8573a57f6 100644 --- a/src/source-erf-dag.c +++ b/src/source-erf-dag.c @@ -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); diff --git a/src/source-erf-file.c b/src/source-erf-file.c index bab7b2652f..1de5bb5f7f 100644 --- a/src/source-erf-file.c +++ b/src/source-erf-file.c @@ -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); diff --git a/src/source-ipfw.c b/src/source-ipfw.c index 6110e5e0e0..0828e4a020 100644 --- a/src/source-ipfw.c +++ b/src/source-ipfw.c @@ -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); diff --git a/src/source-napatech.c b/src/source-napatech.c index 3bb23c69e4..3f719794a8 100644 --- a/src/source-napatech.c +++ b/src/source-napatech.c @@ -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); diff --git a/src/source-netmap.c b/src/source-netmap.c index 9258fdb707..c7f67c10da 100644 --- a/src/source-netmap.c +++ b/src/source-netmap.c @@ -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); diff --git a/src/source-nfq.c b/src/source-nfq.c index a783e03303..fbfbf371d9 100644 --- a/src/source-nfq.c +++ b/src/source-nfq.c @@ -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); diff --git a/src/source-pcap-file.c b/src/source-pcap-file.c index 63fe5b4760..b811d4e3a1 100644 --- a/src/source-pcap-file.c +++ b/src/source-pcap-file.c @@ -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); diff --git a/src/source-pcap.c b/src/source-pcap.c index 0870ec62fe..ee23429c5b 100644 --- a/src/source-pcap.c +++ b/src/source-pcap.c @@ -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); diff --git a/src/source-pfring.c b/src/source-pfring.c index a07ab14c19..a21674037d 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -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); diff --git a/src/source-windivert.c b/src/source-windivert.c index bcf37c6054..3701310d72 100644 --- a/src/source-windivert.c +++ b/src/source-windivert.c @@ -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);