]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: fix midstream syn/ack setup
authorVictor Julien <victor@inliniac.net>
Thu, 10 Apr 2014 15:26:00 +0000 (17:26 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 22 Apr 2014 08:19:41 +0000 (10:19 +0200)
If midstream is enabled and the first packet is the syn/ack packet from
the 3whs, initialized server.last_ack to the packets seq.

This fixes tracking the session.

src/stream-tcp.c

index 0f69138310ad09539d1dd2711fbcdfa60948544b..797ed28c8cf5b49561b11a137ef5919c95a0caf7 100644 (file)
@@ -833,6 +833,8 @@ static int StreamTcpPacketStateNone(ThreadVars *tv, Packet *p,
         ssn->client.next_seq = ssn->client.isn + 1;
 
         ssn->client.last_ack = TCP_GET_ACK(p);
+        ssn->server.last_ack = TCP_GET_SEQ(p);
+
         /** If the client has a wscale option the server had it too,
          *  so set the wscale for the server to max. Otherwise none
          *  will have the wscale opt just like it should. */