]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
defrag: minor cleanups
authorJason Ish <jason.ish@oisf.net>
Fri, 8 Dec 2023 22:27:12 +0000 (16:27 -0600)
committerVictor Julien <vjulien@oisf.net>
Sun, 21 Apr 2024 07:37:13 +0000 (09:37 +0200)
- typo in comment
- remove debug function that is not used and no longer valid

src/defrag.c

index 5c79d4d993b5f818238883e5819ab5d94f03fc15..5afc107b2fda7ce6250ba13bf09337c2ccfb65f1 100644 (file)
@@ -103,26 +103,6 @@ static DefragContext *defrag_context;
 
 RB_GENERATE(IP_FRAGMENTS, Frag_, rb, DefragRbFragCompare);
 
-/**
- * Utility/debugging function to dump the frags associated with a
- * tracker.  Only enable when unit tests are enabled.
- */
-#if 0
-#ifdef UNITTESTS
-static void
-DumpFrags(DefragTracker *tracker)
-{
-    Frag *frag;
-
-    printf("Dumping frags for packet: ID=%d\n", tracker->id);
-    TAILQ_FOREACH(frag, &tracker->frags, next) {
-        printf("-> Frag: frag_offset=%d, frag_len=%d, data_len=%d, ltrim=%d, skip=%d\n", frag->offset, frag->len, frag->data_len, frag->ltrim, frag->skip);
-        PrintRawDataFp(stdout, frag->pkt, frag->len);
-    }
-}
-#endif /* UNITTESTS */
-#endif
-
 /**
  * \brief Reset a frag for reuse in a pool.
  */
@@ -266,7 +246,7 @@ Defrag4Reassemble(ThreadVars *tv, DefragTracker *tracker, Packet *p)
     }
 
     /* Check that we have all the data. Relies on the fact that
-     * fragments are inserted if frag_offset order. */
+     * fragments are inserted in frag_offset order. */
     Frag *frag = NULL;
     size_t len = 0;
     RB_FOREACH_FROM(frag, IP_FRAGMENTS, first) {