|
|
|
@ -1187,7 +1187,7 @@ static int StreamTcpPacketStateNone(
|
|
|
|
|
|
|
|
|
|
ssn->flags |= STREAMTCP_FLAG_TIMESTAMP;
|
|
|
|
|
|
|
|
|
|
ssn->client.last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->client.last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
if (ssn->server.last_ts == 0)
|
|
|
|
|
ssn->server.flags |= STREAMTCP_STREAM_FLAG_ZERO_TIMESTAMP;
|
|
|
|
|
if (ssn->client.last_ts == 0)
|
|
|
|
@ -1294,7 +1294,7 @@ static int StreamTcpPacketStateNone(
|
|
|
|
|
|
|
|
|
|
ssn->flags |= STREAMTCP_FLAG_TIMESTAMP;
|
|
|
|
|
|
|
|
|
|
ssn->server.last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->server.last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
if (ssn->server.last_ts == 0)
|
|
|
|
|
ssn->server.flags |= STREAMTCP_STREAM_FLAG_ZERO_TIMESTAMP;
|
|
|
|
|
if (ssn->client.last_ts == 0)
|
|
|
|
@ -1347,7 +1347,7 @@ static int StreamTcpPacketStateNone(
|
|
|
|
|
if (ssn->client.last_ts == 0)
|
|
|
|
|
ssn->client.flags |= STREAMTCP_STREAM_FLAG_ZERO_TIMESTAMP;
|
|
|
|
|
|
|
|
|
|
ssn->client.last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->client.last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->client.flags |= STREAMTCP_STREAM_FLAG_TIMESTAMP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1455,7 +1455,7 @@ static int StreamTcpPacketStateNone(
|
|
|
|
|
|
|
|
|
|
ssn->flags |= STREAMTCP_FLAG_TIMESTAMP;
|
|
|
|
|
|
|
|
|
|
ssn->client.last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->client.last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
if (ssn->server.last_ts == 0)
|
|
|
|
|
ssn->server.flags |= STREAMTCP_STREAM_FLAG_ZERO_TIMESTAMP;
|
|
|
|
|
if (ssn->client.last_ts == 0)
|
|
|
|
@ -1490,7 +1490,7 @@ static inline void StreamTcp3whsSynAckToStateQueue(Packet *p, TcpStateQueue *q)
|
|
|
|
|
q->win = TCP_GET_RAW_WINDOW(tcph);
|
|
|
|
|
q->seq = TCP_GET_RAW_SEQ(tcph);
|
|
|
|
|
q->ack = TCP_GET_RAW_ACK(tcph);
|
|
|
|
|
q->pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
q->pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
|
|
|
|
|
if (TCP_GET_SACKOK(p))
|
|
|
|
|
q->flags |= STREAMTCP_QUEUE_FLAG_SACK;
|
|
|
|
@ -1753,7 +1753,7 @@ static void TcpStateQueueInitFromPktSyn(const Packet *p, TcpStateQueue *q)
|
|
|
|
|
const TCPHdr *tcph = PacketGetTCP(p);
|
|
|
|
|
|
|
|
|
|
q->win = TCP_GET_RAW_WINDOW(tcph);
|
|
|
|
|
q->pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
q->pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
|
|
|
|
|
if (TCP_GET_SACKOK(p)) {
|
|
|
|
|
q->flags |= STREAMTCP_QUEUE_FLAG_SACK;
|
|
|
|
@ -1786,7 +1786,7 @@ static void TcpStateQueueInitFromPktSynAck(const Packet *p, TcpStateQueue *q)
|
|
|
|
|
|
|
|
|
|
const TCPHdr *tcph = PacketGetTCP(p);
|
|
|
|
|
q->win = TCP_GET_RAW_WINDOW(tcph);
|
|
|
|
|
q->pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
q->pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
|
|
|
|
|
if (TCP_GET_SACKOK(p)) {
|
|
|
|
|
q->flags |= STREAMTCP_QUEUE_FLAG_SACK;
|
|
|
|
@ -2025,7 +2025,7 @@ static int StreamTcpPacketStateSynSent(
|
|
|
|
|
"ssn->server.last_ts %" PRIu32 "",
|
|
|
|
|
ssn, ssn->client.last_ts, ssn->server.last_ts);
|
|
|
|
|
ssn->flags |= STREAMTCP_FLAG_TIMESTAMP;
|
|
|
|
|
ssn->client.last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->client.last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
if (ssn->client.last_ts == 0)
|
|
|
|
|
ssn->client.flags |= STREAMTCP_STREAM_FLAG_ZERO_TIMESTAMP;
|
|
|
|
|
} else {
|
|
|
|
@ -2131,7 +2131,7 @@ static int StreamTcpPacketStateSynSent(
|
|
|
|
|
|
|
|
|
|
if (ssn->server.last_ts == 0)
|
|
|
|
|
ssn->server.flags |= STREAMTCP_STREAM_FLAG_ZERO_TIMESTAMP;
|
|
|
|
|
ssn->server.last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->server.last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->server.flags |= STREAMTCP_STREAM_FLAG_TIMESTAMP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2233,7 +2233,7 @@ static int StreamTcpPacketStateSynSent(
|
|
|
|
|
{
|
|
|
|
|
ssn->flags |= STREAMTCP_FLAG_TIMESTAMP;
|
|
|
|
|
ssn->client.flags &= ~STREAMTCP_STREAM_FLAG_TIMESTAMP;
|
|
|
|
|
ssn->client.last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
ssn->client.last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
} else {
|
|
|
|
|
ssn->client.last_ts = 0;
|
|
|
|
|
ssn->client.flags &= ~STREAMTCP_STREAM_FLAG_ZERO_TIMESTAMP;
|
|
|
|
@ -6350,7 +6350,7 @@ static int StreamTcpValidateTimestamp (TcpSession *ssn, Packet *p)
|
|
|
|
|
if (last_pkt_ts == 0 &&
|
|
|
|
|
(ssn->flags & STREAMTCP_FLAG_MIDSTREAM))
|
|
|
|
|
{
|
|
|
|
|
last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result < 0) {
|
|
|
|
@ -6494,7 +6494,7 @@ static int StreamTcpHandleTimestamp (TcpSession *ssn, Packet *p)
|
|
|
|
|
if (sender_stream->last_pkt_ts == 0 &&
|
|
|
|
|
(ssn->flags & STREAMTCP_FLAG_MIDSTREAM))
|
|
|
|
|
{
|
|
|
|
|
sender_stream->last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
sender_stream->last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result < 0) {
|
|
|
|
@ -6519,7 +6519,7 @@ static int StreamTcpHandleTimestamp (TcpSession *ssn, Packet *p)
|
|
|
|
|
if (SEQ_EQ(sender_stream->next_seq, seq))
|
|
|
|
|
sender_stream->last_ts = ts;
|
|
|
|
|
|
|
|
|
|
sender_stream->last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
sender_stream->last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
|
|
|
|
|
} else if (ret == 0) {
|
|
|
|
|
/* if the timestamp of packet is not valid then, check if the
|
|
|
|
@ -6529,7 +6529,7 @@ static int StreamTcpHandleTimestamp (TcpSession *ssn, Packet *p)
|
|
|
|
|
(((uint32_t)SCTIME_SECS(p->ts) >
|
|
|
|
|
(sender_stream->last_pkt_ts + PAWS_24DAYS)))) {
|
|
|
|
|
sender_stream->last_ts = ts;
|
|
|
|
|
sender_stream->last_pkt_ts = SCTIME_SECS(p->ts);
|
|
|
|
|
sender_stream->last_pkt_ts = (uint32_t)SCTIME_SECS(p->ts);
|
|
|
|
|
|
|
|
|
|
SCLogDebug("timestamp considered valid anyway");
|
|
|
|
|
} else {
|
|
|
|
|