From: Arne Schwabe Date: Mon, 10 Aug 2020 14:37:01 +0000 (+0200) Subject: Eliminate check_tls wrapper function X-Git-Tag: v2.5_beta1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd88d947b100deb55bb8388fd2f1e95e0af4a658;p=thirdparty%2Fopenvpn.git Eliminate check_tls wrapper function Move check into caller. Remove two in function forward declarations that are not needed from check_tls_errors. Signed-off-by: Arne Schwabe Acked-by: Gert Doering 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 --- diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 0e05b08b9..36e5c1759 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -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); diff --git a/src/openvpn/forward.h b/src/openvpn/forward.h index 27e7fde72..a8b19f694 100644 --- a/src/openvpn/forward.h +++ b/src/openvpn/forward.h @@ -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);