]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Eliminate check_tls wrapper function
authorArne Schwabe <arne@rfc2549.org>
Mon, 10 Aug 2020 14:37:01 +0000 (16:37 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 10 Aug 2020 18:16:20 +0000 (20:16 +0200)
Move check into caller.

Remove two in function forward declarations that are not needed from
check_tls_errors.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200810143707.5834-12-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20670.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/forward.c
src/openvpn/forward.h

index 0e05b08b94523d1f2043f36f6fb71cac4bb3a762..36e5c17599d9fb6b69e8bd2d43e33e10a2f1d379 100644 (file)
@@ -77,20 +77,6 @@ show_wait_status(struct context *c)
 
 #endif /* ifdef ENABLE_DEBUG */
 
-/*
- * Does TLS session need service?
- */
-static inline void
-check_tls(struct context *c)
-{
-    void check_tls_dowork(struct context *c);
-
-    if (c->c2.tls_multi)
-    {
-        check_tls_dowork(c);
-    }
-}
-
 /*
  * TLS errors are fatal in TCP mode.
  * Also check for --tls-exit trigger.
@@ -98,10 +84,6 @@ check_tls(struct context *c)
 static inline void
 check_tls_errors(struct context *c)
 {
-    void check_tls_errors_co(struct context *c);
-
-    void check_tls_errors_nco(struct context *c);
-
     if (c->c2.tls_multi && c->c2.tls_exit_signal)
     {
         if (link_socket_connection_oriented(c->c2.link_socket))
@@ -157,7 +139,7 @@ context_reschedule_sec(struct context *c, int sec)
  *
  */
 void
-check_tls_dowork(struct context *c)
+check_tls(struct context *c)
 {
     interval_t wakeup = BIG_TIMEOUT;
 
@@ -1852,8 +1834,11 @@ pre_select(struct context *c)
         return;
     }
 
-    /* Does TLS need service? */
-    check_tls(c);
+    /* If tls is enabled, do tls control channel packet processing. */
+    if (c->c2.tls_multi)
+    {
+        check_tls(c);
+    }
 
     /* In certain cases, TLS errors will require a restart */
     check_tls_errors(c);
index 27e7fde72e5b524a41c15959556bb6df325f6bcc..a8b19f694fb01287a484f0de4cd28c687a85de51 100644 (file)
@@ -68,7 +68,7 @@ extern counter_type link_read_bytes_global;
 
 extern counter_type link_write_bytes_global;
 
-void check_tls_dowork(struct context *c);
+void check_tls(struct context *c);
 
 void check_tls_errors_co(struct context *c);