pping: Only match TSecr in ACKs

The echoed TCP timestamp (TSecr) is only valid if the ACK flag is
set. So make sure to only attempt to match on ACK packets.

Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
This commit is contained in:
Simon Sundberg
2021-06-21 10:51:20 +02:00
parent c14f52a4d4
commit af5e660d8e
2 changed files with 6 additions and 0 deletions

View File

@@ -153,6 +153,10 @@ static int parse_tcp_identifier(struct parsing_context *ctx, __be16 *sport,
!tcph->syn)
return -1;
// Do not match on non-ACKs (TSecr not valid)
if (!ctx->is_egress && !tcph->ack)
return -1;
// Check if connection is opening/closing
if (tcph->syn) {
fei->event = FLOW_EVENT_OPENING;