Skip to content

Commit 310c6b9

Browse files
flichtenheldcron2
authored andcommitted
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 <[email protected]> Acked-by: Gert Doering <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1311 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg35075.html Signed-off-by: Gert Doering <[email protected]>
1 parent 223192a commit 310c6b9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/openvpn/multi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3820,7 +3820,6 @@ multi_push_restart_schedule_exit(struct multi_context *m, bool next_server)
38203820
{
38213821
struct hash_iterator hi;
38223822
struct hash_element *he;
3823-
struct timeval tv;
38243823

38253824
/* tell all clients to restart */
38263825
hash_iterator_init(m->iter, &hi);
@@ -3838,15 +3837,14 @@ multi_push_restart_schedule_exit(struct multi_context *m, bool next_server)
38383837

38393838
/* reschedule signal */
38403839
ASSERT(!openvpn_gettimeofday(&m->deferred_shutdown_signal.wakeup, NULL));
3841-
tv.tv_sec = 2;
3842-
tv.tv_usec = 0;
3840+
struct timeval tv = { .tv_sec = 2, .tv_usec = 0 };
38433841
tv_add(&m->deferred_shutdown_signal.wakeup, &tv);
38443842

38453843
m->deferred_shutdown_signal.signal_received = m->top.sig->signal_received;
38463844

38473845
schedule_add_entry(m->schedule, (struct schedule_entry *)&m->deferred_shutdown_signal,
38483846
&m->deferred_shutdown_signal.wakeup,
3849-
compute_wakeup_sigma(&m->deferred_shutdown_signal.wakeup));
3847+
compute_wakeup_sigma(&tv));
38503848

38513849
signal_reset(m->top.sig, 0);
38523850
}

0 commit comments

Comments
 (0)