StatsIncr(tv, ra_ctx->counter_tcp_reass_data_normal_fail);
StreamTcpRemoveSegmentFromStream(stream, seg);
StreamTcpSegmentReturntoPool(seg);
+ if (res == -1) {
+ SCReturnInt(-ENOMEM);
+ }
SCReturnInt(-1);
}
if (seg == NULL) {
SCLogDebug("segment_pool is empty");
StreamTcpSetEvent(p, STREAM_REASSEMBLY_NO_SEGMENT);
+ ssn->lossy_be_liberal = true;
SCReturnInt(-1);
}
APPLAYER_PROTO_DETECTION_SKIPPED);
}
- if (StreamTcpReassembleInsertSegment(tv, ra_ctx, stream, seg, p, TCP_GET_SEQ(p), p->payload, p->payload_len) != 0) {
+ int r = StreamTcpReassembleInsertSegment(
+ tv, ra_ctx, stream, seg, p, TCP_GET_SEQ(p), p->payload, p->payload_len);
+ if (r < 0) {
+ if (r == -ENOMEM) {
+ ssn->lossy_be_liberal = true;
+ }
SCLogDebug("StreamTcpReassembleInsertSegment failed");
SCReturnInt(-1);
}
StreamTcpSetEvent(p, STREAM_REASSEMBLY_SEQ_GAP);
StatsIncr(tv, ra_ctx->counter_tcp_reass_gap);
+ ssn->lossy_be_liberal = true;
/* AppLayerHandleTCPData has likely updated progress. */
const bool no_progress_update = (app_progress == STREAM_APP_PROGRESS(*stream));
{
uint8_t os_policy;
+ if (ssn->lossy_be_liberal) {
+ SCReturnInt(1);
+ }
+
if (ssn->flags & STREAMTCP_FLAG_TIMESTAMP) {
if (!StreamTcpValidateTimestamp(ssn, p)) {
SCReturnInt(0);