From 503cc3de690be563762956f6639fcec16e7a1d79 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 30 Oct 2014 11:07:38 +0100 Subject: [PATCH] stream/async: improve handling of syn/ack pickup If we picked up the ssn with a syn/ack, we don't need to make more assumptions about sack and wscale after that. --- src/stream-tcp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 76b256bc99..5bb30f614a 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -1774,11 +1774,13 @@ static int StreamTcpPacketStateSynRecv(ThreadVars *tv, Packet *p, ssn->client.next_win = ssn->client.last_ack + ssn->client.window; ssn->server.next_win = ssn->server.last_ack + ssn->server.window; - /* window scaling for midstream pickups, we can't do much - * other than assume that it's set to the max value: 14 */ - ssn->server.wscale = TCP_WSCALE_MAX; - ssn->client.wscale = TCP_WSCALE_MAX; - ssn->flags |= STREAMTCP_FLAG_SACKOK; + if (!(ssn->flags & STREAMTCP_FLAG_MIDSTREAM_SYNACK)) { + /* window scaling for midstream pickups, we can't do much + * other than assume that it's set to the max value: 14 */ + ssn->server.wscale = TCP_WSCALE_MAX; + ssn->client.wscale = TCP_WSCALE_MAX; + ssn->flags |= STREAMTCP_FLAG_SACKOK; + } } StreamTcpPacketSetState(p, ssn, TCP_ESTABLISHED); -- 2.47.2