From: Frank Lichtenheld Date: Mon, 15 Dec 2025 15:04:54 +0000 (+0100) Subject: multi: Fix wrong sigma value in multi_push_restart_schedule_exit X-Git-Tag: v2.7_rc4~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=310c6b9e789a102b71ad9d4ba56bc11d1c8a0a73;p=thirdparty%2Fopenvpn.git multi: Fix wrong sigma value in multi_push_restart_schedule_exit Sigma was computed based on the absolute time and not the delta. Note that this probably makes no actual difference in practice. The sigma value is irrelevant on first call and multi_push_restart_schedule_exit should not be called multiple times since it is only called if deferred_shutdown_signal.signal_received is not set, yet. Change-Id: I62b8263f18c4e2e7f5ecacb4616737f5ba836303 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1311 Message-Id: <20251215150500.18898-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35075.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index d2d9ba8e1..d9cb3a908 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3820,7 +3820,6 @@ multi_push_restart_schedule_exit(struct multi_context *m, bool next_server) { struct hash_iterator hi; struct hash_element *he; - struct timeval tv; /* tell all clients to restart */ hash_iterator_init(m->iter, &hi); @@ -3838,15 +3837,14 @@ multi_push_restart_schedule_exit(struct multi_context *m, bool next_server) /* reschedule signal */ ASSERT(!openvpn_gettimeofday(&m->deferred_shutdown_signal.wakeup, NULL)); - tv.tv_sec = 2; - tv.tv_usec = 0; + struct timeval tv = { .tv_sec = 2, .tv_usec = 0 }; tv_add(&m->deferred_shutdown_signal.wakeup, &tv); m->deferred_shutdown_signal.signal_received = m->top.sig->signal_received; schedule_add_entry(m->schedule, (struct schedule_entry *)&m->deferred_shutdown_signal, &m->deferred_shutdown_signal.wakeup, - compute_wakeup_sigma(&m->deferred_shutdown_signal.wakeup)); + compute_wakeup_sigma(&tv)); signal_reset(m->top.sig, 0); }