tcp: improve check for invalid sack blocks

Change-Id: Ic6a6202a2d5aca33eee7fc6ff8eeaa1db9b58525
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index 0e91550..dff1802 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -905,7 +905,9 @@
     {
       if (seq_lt (blk->start, blk->end)
 	  && seq_gt (blk->start, tc->snd_una)
-	  && seq_gt (blk->start, ack) && seq_leq (blk->end, tc->snd_una_max))
+	  && seq_gt (blk->start, ack)
+	  && seq_lt (blk->start, tc->snd_una_max)
+	  && seq_leq (blk->end, tc->snd_una_max))
 	{
 	  blk++;
 	  continue;