Check timestamp_diff return code correctly

This commit is contained in:
William Robinet 2021-01-27 18:31:28 +01:00
parent 2a7b0f664f
commit f24eafd8b4

View file

@ -170,7 +170,8 @@ int clean_old_conn() {
while(conn) { while(conn) {
tcpconn = &conn->conn; tcpconn = &conn->conn;
conn=conn->next; 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) { if(dt.tv_sec > conn_ttl) {
i++; i++;
tcp_destroy_conn(tcpconn); tcp_destroy_conn(tcpconn);