From f24eafd8b4ec085e37388c80f9916f7590a7f472 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Wed, 27 Jan 2021 18:31:28 +0100 Subject: [PATCH] Check timestamp_diff return code correctly --- base/tcpconn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/tcpconn.c b/base/tcpconn.c index cee0e9f..820f50c 100644 --- a/base/tcpconn.c +++ b/base/tcpconn.c @@ -170,7 +170,8 @@ int clean_old_conn() { while(conn) { tcpconn = &conn->conn; conn=conn->next; - timestamp_diff(&last_packet_seen_time, &tcpconn->last_seen_time, &dt); + if(timestamp_diff(&last_packet_seen_time, &tcpconn->last_seen_time, &dt)) + continue; if(dt.tv_sec > conn_ttl) { i++; tcp_destroy_conn(tcpconn);