aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe2022-04-26 15:23:23 +0200
committerGert Doering2022-04-26 15:39:16 +0200
commit04c3779922aed541755a20f415e7cb9d717ee7ed (patch)
tree0fcfde2abe2566e2e235ad8eea149007bf130202
parentedc3e9f5c939ca40841b8054732bfae47aad7e11 (diff)
downloadopenvpn-04c3779922aed541755a20f415e7cb9d717ee7ed.zip
openvpn-04c3779922aed541755a20f415e7cb9d717ee7ed.tar.gz
Change FULL_SYNC macro to no_pending_reliable_packets function
This changes this macro to a better named inline function. This introduces a slight whitespace problem but the next refactoring will move the incorrectly intended block to its own function anyway. Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20220426132324.76517-1-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24213.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
-rw-r--r--src/openvpn/ssl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index bad59f2..6c6648a 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -1774,8 +1774,11 @@ flush_payload_buffer(struct key_state *ks)
}
/* true if no in/out acknowledgements pending */
-#define FULL_SYNC \
- (reliable_empty(ks->send_reliable) && reliable_ack_empty(ks->rec_ack))
+static bool
+no_pending_reliable_packets(struct key_state *ks)
+{
+ return (reliable_empty(ks->send_reliable) && reliable_ack_empty(ks->rec_ack));
+}
/*
* Move the active key to the lame duck key and reinitialize the
@@ -2518,7 +2521,7 @@ tls_process(struct tls_multi *multi,
}
/* Wait for Initial Handshake ACK */
- if (ks->state == S_PRE_START && FULL_SYNC)
+ if (ks->state == S_PRE_START && no_pending_reliable_packets(ks))
{
ks->state = S_START;
state_change = true;
@@ -2544,7 +2547,7 @@ tls_process(struct tls_multi *multi,
if (((ks->state == S_GOT_KEY && !session->opt->server)
|| (ks->state == S_SENT_KEY && session->opt->server)))
{
- if (FULL_SYNC)
+ if (no_pending_reliable_packets(ks))
{
ks->established = now;
dmsg(D_TLS_DEBUG_MED, "STATE S_ACTIVE");