Skip to content

Commit

Permalink
decode: remove pseudo packet checks
Browse files Browse the repository at this point in the history
Bug 1107 checks/hacks should not longer be needed, so remove them.
  • Loading branch information
victorjulien committed Feb 7, 2020
1 parent 272a5f5 commit 7810f22
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 46 deletions.
5 changes: 1 addition & 4 deletions src/source-af-packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/source-erf-dag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/source-erf-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/source-ipfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/source-napatech.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/source-netmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/source-nfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 1 addition & 4 deletions src/source-pcap-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/source-pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/source-pfring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 1 addition & 6 deletions src/source-windivert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7810f22

Please sign in to comment.