]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: validate SACK right edge to be in window
authorVictor Julien <victor@inliniac.net>
Mon, 27 Feb 2017 11:27:11 +0000 (12:27 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 24 Mar 2017 14:16:50 +0000 (15:16 +0100)
src/stream-tcp-sack.c

index d3be60e9200ccfae0a0146e1316d901bd667c7cc..ab0ad57faa827c048462acc6be1f1242f9f332e5 100644 (file)
@@ -271,13 +271,12 @@ int StreamTcpSackUpdatePacket(TcpStream *stream, Packet *p)
             goto next;
         }
 
-        /** \todo need a metric to a check for a right edge limit */
-/*
-        if (SEQ_GT(ntohl(sack_rec->re), stream->next_seq)) {
-            SCLogDebug("record beyond next_seq %u", stream->next_seq);
+        if (SEQ_GT(ntohl(sack_rec->re), stream->next_win)) {
+            SCLogDebug("record %u:%u beyond next_win %u",
+                    ntohl(sack_rec->le), ntohl(sack_rec->re), stream->next_win);
             goto next;
         }
-*/
+
         if (SEQ_GEQ(ntohl(sack_rec->le), ntohl(sack_rec->re))) {
             SCLogDebug("invalid record: le >= re");
             goto next;