From: Victor Julien Date: Wed, 15 Feb 2023 08:41:31 +0000 (+0100) Subject: stream: remove usused thread pseudo packet queue X-Git-Tag: suricata-7.0.0-rc2~576 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58c1f14f177ed86dde74be04b39d08e050de17b0;p=thirdparty%2Fsuricata.git stream: remove usused thread pseudo packet queue --- diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 41fec85296..65d9df3344 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -5112,31 +5112,7 @@ int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt, } } - /* deal with a pseudo packet that is created upon receiving a RST - * segment. To be sure we process both sides of the connection, we - * inject a fake packet into the system, forcing reassembly of the - * opposing direction. - * There should be only one, but to be sure we do a while loop. */ if (ssn != NULL) { - while (stt->pseudo_queue.len > 0) { - SCLogDebug("processing pseudo packet / stream end"); - Packet *np = PacketDequeueNoLock(&stt->pseudo_queue); - if (np != NULL) { - /* process the opposing direction of the original packet */ - if (PKT_IS_TOSERVER(np)) { - SCLogDebug("pseudo packet is to server"); - StreamTcpReassembleHandleSegment(tv, stt->ra_ctx, ssn, &ssn->client, np); - } else { - SCLogDebug("pseudo packet is to client"); - StreamTcpReassembleHandleSegment(tv, stt->ra_ctx, ssn, &ssn->server, np); - } - - /* enqueue this packet so we inspect it in detect etc */ - PacketEnqueueNoLock(pq, np); - } - SCLogDebug("processing pseudo packet / stream end done"); - } - /* recalc the csum on the packet if it was modified */ if (p->flags & PKT_STREAM_MODIFIED) { ReCalculateChecksum(p); @@ -5186,14 +5162,6 @@ int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt, SCReturnInt(0); error: - /* make sure we don't leave packets in our pseudo queue */ - while (stt->pseudo_queue.len > 0) { - Packet *np = PacketDequeueNoLock(&stt->pseudo_queue); - if (np != NULL) { - PacketEnqueueNoLock(pq, np); - } - } - /* recalc the csum on the packet if it was modified */ if (p->flags & PKT_STREAM_MODIFIED) { ReCalculateChecksum(p); diff --git a/src/stream-tcp.h b/src/stream-tcp.h index 733961d2be..375465e00e 100644 --- a/src/stream-tcp.h +++ b/src/stream-tcp.h @@ -75,11 +75,6 @@ typedef struct TcpStreamCnf_ { typedef struct StreamTcpThread_ { int ssn_pool_id; - /** queue for pseudo packet(s) that were created in the stream - * process and need further handling. Currently only used when - * receiving (valid) RST packets */ - PacketQueueNoLock pseudo_queue; - uint16_t counter_tcp_active_sessions; uint16_t counter_tcp_sessions; /** sessions not picked up because memcap was reached */