From: Arne Schwabe Date: Mon, 10 Aug 2020 14:36:58 +0000 (+0200) Subject: Rename check_ping_restart_dowork to trigger_ping_timeout_signal X-Git-Tag: v2.5_beta1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76ea0859c5d0549f5d6193cbd5e43873e22d5906;p=thirdparty%2Fopenvpn.git Rename check_ping_restart_dowork to trigger_ping_timeout_signal Rename the function to better capture its actual function. Signed-off-by: Arne Schwabe Acked-by: Gert Doering Message-Id: <20200810143707.5834-9-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20675.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/ping.c b/src/openvpn/ping.c index 358d54b0f..aa176fdbd 100644 --- a/src/openvpn/ping.c +++ b/src/openvpn/ping.c @@ -46,12 +46,8 @@ const uint8_t ping_string[] = { 0x07, 0xed, 0x2d, 0x0a, 0x98, 0x1f, 0xc7, 0x48 }; -/* - * Should we exit or restart due to ping (or other authenticated packet) - * not received in n seconds? - */ void -check_ping_restart_dowork(struct context *c) +trigger_ping_timeout_signal(struct context *c) { struct gc_arena gc = gc_new(); switch (c->options.ping_rec_timeout_action) diff --git a/src/openvpn/ping.h b/src/openvpn/ping.h index b51f082a1..6feaa8789 100644 --- a/src/openvpn/ping.h +++ b/src/openvpn/ping.h @@ -43,7 +43,12 @@ is_ping_msg(const struct buffer *buf) return buf_string_match(buf, ping_string, PING_STRING_SIZE); } -void check_ping_restart_dowork(struct context *c); +/** + * Trigger the correct signal on a --ping timeout + * depending if --ping-exit is set (SIGTERM) or not + * (SIGUSR1) + */ +void trigger_ping_timeout_signal(struct context *c); void check_ping_send_dowork(struct context *c); @@ -54,8 +59,6 @@ void check_ping_send_dowork(struct context *c); static inline void check_ping_restart(struct context *c) { - void check_ping_restart_dowork(struct context *c); - if (c->options.ping_rec_timeout && event_timeout_trigger(&c->c2.ping_rec_interval, &c->c2.timeval, @@ -63,7 +66,7 @@ check_ping_restart(struct context *c) || link_socket_actual_defined(&c->c1.link_socket_addr.actual)) ? ETT_DEFAULT : 15)) { - check_ping_restart_dowork(c); + trigger_ping_timeout_signal(c); } } @@ -73,8 +76,6 @@ check_ping_restart(struct context *c) static inline void check_ping_send(struct context *c) { - void check_ping_send_dowork(struct context *c); - if (c->options.ping_send_timeout && event_timeout_trigger(&c->c2.ping_send_interval, &c->c2.timeval,