]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Rename check_ping_restart_dowork to trigger_ping_timeout_signal
authorArne Schwabe <arne@rfc2549.org>
Mon, 10 Aug 2020 14:36:58 +0000 (16:36 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 10 Aug 2020 17:41:45 +0000 (19:41 +0200)
Rename the function to better capture its actual function.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
src/openvpn/ping.c
src/openvpn/ping.h

index 358d54b0f4a090a63b0ba856ab77e020bab4fc00..aa176fdbda3509ad2c81ce8b233608de571955d8 100644 (file)
@@ -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)
index b51f082a190d5067fd895c5c797663b8f503b30a..6feaa878912399ebc30990a7b01010f4b9a310fe 100644 (file)
@@ -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,