]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: remove usused thread pseudo packet queue
authorVictor Julien <vjulien@oisf.net>
Wed, 15 Feb 2023 08:41:31 +0000 (09:41 +0100)
committerVictor Julien <vjulien@oisf.net>
Wed, 15 Feb 2023 11:12:06 +0000 (12:12 +0100)
src/stream-tcp.c
src/stream-tcp.h

index 41fec852963d986088e4fcfb815195fdbf9fe41a..65d9df33446da7859bf8af696392841e8fc317de 100644 (file)
@@ -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);
index 733961d2be8247b1fb427a6c30a0c2ad5785b964..375465e00e55f2cba37b0b5f1c3871c21b0c9849 100644 (file)
@@ -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 */