stats: Track stream reassembly drops

Issue: 6235
pull/9492/head
Jeff Lucovsky 2 years ago committed by Victor Julien
parent 908f49eef1
commit 904f0ddeee

@ -40,7 +40,8 @@
"type": "integer" "type": "integer"
}, },
"host": { "host": {
"$comment": "May change to sensor_name in the future, or become user configurable: https://redmine.openinfosecfoundation.org/issues/4919", "$comment":
"May change to sensor_name in the future, or become user configurable: https://redmine.openinfosecfoundation.org/issues/4919",
"description": "the sensor-name, if configured", "description": "the sensor-name, if configured",
"type": "string" "type": "string"
}, },
@ -4095,6 +4096,9 @@
"stream_midstream": { "stream_midstream": {
"type": "integer" "type": "integer"
}, },
"stream_reassembly": {
"type": "integer"
},
"nfq_error": { "nfq_error": {
"type": "integer" "type": "integer"
}, },

@ -804,6 +804,8 @@ const char *PacketDropReasonToString(enum PacketDropReason r)
return "stream memcap"; return "stream memcap";
case PKT_DROP_REASON_STREAM_MIDSTREAM: case PKT_DROP_REASON_STREAM_MIDSTREAM:
return "stream midstream"; return "stream midstream";
case PKT_DROP_REASON_STREAM_REASSEMBLY:
return "stream reassembly";
case PKT_DROP_REASON_APPLAYER_ERROR: case PKT_DROP_REASON_APPLAYER_ERROR:
return "applayer error"; return "applayer error";
case PKT_DROP_REASON_APPLAYER_MEMCAP: case PKT_DROP_REASON_APPLAYER_MEMCAP:
@ -842,6 +844,8 @@ static const char *PacketDropReasonToJsonString(enum PacketDropReason r)
return "ips.drop_reason.stream_memcap"; return "ips.drop_reason.stream_memcap";
case PKT_DROP_REASON_STREAM_MIDSTREAM: case PKT_DROP_REASON_STREAM_MIDSTREAM:
return "ips.drop_reason.stream_midstream"; return "ips.drop_reason.stream_midstream";
case PKT_DROP_REASON_STREAM_REASSEMBLY:
return "ips.drop_reason.stream_reassembly";
case PKT_DROP_REASON_APPLAYER_ERROR: case PKT_DROP_REASON_APPLAYER_ERROR:
return "ips.drop_reason.applayer_error"; return "ips.drop_reason.applayer_error";
case PKT_DROP_REASON_APPLAYER_MEMCAP: case PKT_DROP_REASON_APPLAYER_MEMCAP:

@ -401,6 +401,7 @@ enum PacketDropReason {
PKT_DROP_REASON_STREAM_ERROR, PKT_DROP_REASON_STREAM_ERROR,
PKT_DROP_REASON_STREAM_MEMCAP, PKT_DROP_REASON_STREAM_MEMCAP,
PKT_DROP_REASON_STREAM_MIDSTREAM, PKT_DROP_REASON_STREAM_MIDSTREAM,
PKT_DROP_REASON_STREAM_REASSEMBLY,
PKT_DROP_REASON_NFQ_ERROR, /**< no nfq verdict, must be error */ PKT_DROP_REASON_NFQ_ERROR, /**< no nfq verdict, must be error */
PKT_DROP_REASON_INNER_PACKET, /**< drop issued by inner (tunnel) packet */ PKT_DROP_REASON_INNER_PACKET, /**< drop issued by inner (tunnel) packet */
PKT_DROP_REASON_MAX, PKT_DROP_REASON_MAX,

@ -2017,7 +2017,7 @@ int StreamTcpReassembleHandleSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_
SCLogDebug("StreamTcpReassembleHandleSegmentHandleData error"); SCLogDebug("StreamTcpReassembleHandleSegmentHandleData error");
/* failure can only be because of memcap hit, so see if this should lead to a drop */ /* failure can only be because of memcap hit, so see if this should lead to a drop */
ExceptionPolicyApply( ExceptionPolicyApply(
p, stream_config.reassembly_memcap_policy, PKT_DROP_REASON_STREAM_MEMCAP); p, stream_config.reassembly_memcap_policy, PKT_DROP_REASON_STREAM_REASSEMBLY);
SCReturnInt(-1); SCReturnInt(-1);
} }

Loading…
Cancel
Save