#define STREAM_PKT_FLAG_EVENTSET BIT_U16(6)
#define STREAM_PKT_FLAG_DUP_ACK BIT_U16(7)
#define STREAM_PKT_FLAG_DSACK BIT_U16(8)
+#define STREAM_PKT_FLAG_ACK_UNSEEN_DATA BIT_U16(9)
#define STREAM_PKT_FLAG_SET(p, f) (p)->tcpvars.stream_pkt_flags |= (f)
ssn->server.window);
/* Check if the ACK value is sane and inside the window limit */
- if (p->tcph->th_flags & TH_ACK)
+ if (p->tcph->th_flags & TH_ACK) {
StreamTcpUpdateLastAck(ssn, &ssn->server, TCP_GET_ACK(p));
+ if ((ssn->flags & STREAMTCP_FLAG_ASYNC) == 0 &&
+ SEQ_GT(ssn->server.last_ack, ssn->server.next_seq)) {
+ STREAM_PKT_FLAG_SET(p, STREAM_PKT_FLAG_ACK_UNSEEN_DATA);
+ }
+ }
+
SCLogDebug("ack %u last_ack %u next_seq %u", TCP_GET_ACK(p), ssn->server.last_ack, ssn->server.next_seq);
if (ssn->flags & STREAMTCP_FLAG_TIMESTAMP) {
SCLogDebug("ssn %p: ssn->client.window %"PRIu32"", ssn,
ssn->client.window);
- if (p->tcph->th_flags & TH_ACK)
+ if (p->tcph->th_flags & TH_ACK) {
StreamTcpUpdateLastAck(ssn, &ssn->client, TCP_GET_ACK(p));
+ if ((ssn->flags & STREAMTCP_FLAG_ASYNC) == 0 &&
+ SEQ_GT(ssn->client.last_ack, ssn->client.next_seq)) {
+ STREAM_PKT_FLAG_SET(p, STREAM_PKT_FLAG_ACK_UNSEEN_DATA);
+ }
+ }
if (ssn->flags & STREAMTCP_FLAG_TIMESTAMP) {
StreamTcpHandleTimestamp(ssn, p);