From 89388506dd7d88adfc9188547341d7f36bcce397 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 22 Feb 2018 22:35:32 +0100 Subject: ipcpd: Reset flow statistics on reuse The flow statistics were not reset when a new connection was created, resulting in wrong statistics. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/normal/dt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ipcpd/normal/dt.c b/src/ipcpd/normal/dt.c index ebe8b01a..adf07d1a 100644 --- a/src/ipcpd/normal/dt.c +++ b/src/ipcpd/normal/dt.c @@ -272,6 +272,8 @@ static void set_used(int fd, pthread_mutex_lock(&dt.stat[fd].lock); + memset(&dt.stat[fd], 0, sizeof(dt.stat[fd])); + dt.stat[fd].stamp = b ? now.tv_sec : 0; pthread_mutex_unlock(&dt.stat[fd].lock); -- cgit v1.2.3