]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream/sack: minor debug improvements
authorVictor Julien <victor@inliniac.net>
Mon, 4 Jan 2021 21:10:58 +0000 (22:10 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 2 Jul 2021 08:53:23 +0000 (10:53 +0200)
src/stream-tcp-sack.c

index cb60c525b93c3bff98cee8eb6043dc373072374a..f26c5ebab0e017b0bd30ffcebd6f79e783702477 100644 (file)
@@ -184,7 +184,7 @@ static inline void ConsolidateBackward(TcpStream *stream,
 
 static int Insert(TcpStream *stream, struct TCPSACK *tree, uint32_t le, uint32_t re)
 {
-    SCLogDebug("* inserting: %u/%u\n", le, re);
+    SCLogDebug("inserting: %u-%u", le, re);
 
     struct StreamTcpSackRecord *sa = StreamTcpSackRecordAlloc();
     if (unlikely(sa == NULL))
@@ -248,11 +248,13 @@ static int StreamTcpSackInsertRange(TcpStream *stream, uint32_t le, uint32_t re)
  */
 int StreamTcpSackUpdatePacket(TcpStream *stream, Packet *p)
 {
+    SCEnter();
+
     const int records = TCP_GET_SACK_CNT(p);
     const uint8_t *data = TCP_GET_SACK_PTR(p);
 
     if (records == 0 || data == NULL)
-        return 0;
+        SCReturnInt(0);
 
     TCPOptSackRecord rec[records], *sack_rec = rec;
     memcpy(&rec, data, sizeof(TCPOptSackRecord) * records);