mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user