From a5953208fc7d09007e9ddf6ca170f0ac413a0b8f Mon Sep 17 00:00:00 2001 From: mvs Date: Sun, 26 Jun 2022 21:29:34 +0000 Subject: [PATCH] Don't reset `idle_time' timeout on closed pipex(4) sessions in packet processing path. Such sessions already reached time to live timeout, and the garbage collector waits a little to before kill them. Otherwise we could make session's life time more then PIPEX_CLOSE_TIMEOUT. ok bluhm@ --- sys/net/pipex.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/net/pipex.c b/sys/net/pipex.c index 40a19037a51..33e5e2351ef 100644 --- a/sys/net/pipex.c +++ b/sys/net/pipex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex.c,v 1.139 2022/06/26 18:56:09 mvs Exp $ */ +/* $OpenBSD: pipex.c,v 1.140 2022/06/26 21:29:34 mvs Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -779,7 +779,8 @@ pipex_ip_output(struct mbuf *m0, struct pipex_session *session) if (is_idle == 0) { mtx_enter(&pipex_list_mtx); /* update expire time */ - session->idle_time = 0; + if (session->state == PIPEX_STATE_OPENED) + session->idle_time = 0; mtx_leave(&pipex_list_mtx); } } @@ -1001,7 +1002,8 @@ pipex_ip_input(struct mbuf *m0, struct pipex_session *session) if (is_idle == 0) { /* update expire time */ mtx_enter(&pipex_list_mtx); - session->idle_time = 0; + if (session->state == PIPEX_STATE_OPENED) + session->idle_time = 0; mtx_leave(&pipex_list_mtx); } } -- 2.20.1