1
0
mirror of https://passt.top/passt synced 2024-12-22 13:45:32 +00:00

tcp: Fix botched timeout comparison

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-10-04 22:17:22 +02:00
parent 98dfe1cdf4
commit 52054d8b37

4
tcp.c
View File

@ -3389,8 +3389,8 @@ static void tcp_timer_one(struct ctx *c, struct tcp_tap_conn *conn,
int tap_act = timespec_diff_ms(ts, &conn->ts_tap_act); int tap_act = timespec_diff_ms(ts, &conn->ts_tap_act);
int tap_data_noack; int tap_data_noack;
if (memcmp(&conn->tap_data_noack, &((struct timespec){ 0, 0 }), if (!memcmp(&conn->tap_data_noack, &((struct timespec){ 0, 0 }),
sizeof(struct timespec))) sizeof(struct timespec)))
tap_data_noack = 0; tap_data_noack = 0;
else else
tap_data_noack = timespec_diff_ms(ts, &conn->tap_data_noack); tap_data_noack = timespec_diff_ms(ts, &conn->tap_data_noack);