[Openvpn-devel] init.c: refine functions names and description

Message ID 1538818219-18141-1-git-send-email-lstipakov@gmail.com
State Accepted
Headers show
Series [Openvpn-devel] init.c: refine functions names and description | expand

Commit Message

Lev Stipakov Oct. 5, 2018, 11:30 p.m. UTC
From: Lev Stipakov <lev@openvpn.net>

This patch provides better naming and description
for functions which deal with backup/restore NCP-negotiable
options.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
---
 src/openvpn/init.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

Comments

Gert Doering Oct. 6, 2018, 12:16 a.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

No (real) code changes, just comment and function *names*.

Your patch has been applied to the master and release/2.4 branch.

commit 39326238dca7c28368928f728c5a3c80031255e5 (master)
commit 6f8fb6fe796015051f30d1327d89e1a63cf592e8 (release/2.4)
Author: Lev Stipakov
Date:   Sat Oct 6 12:30:19 2018 +0300

     init.c: refine functions names and description

     Signed-off-by: Lev Stipakov <lev@openvpn.net>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <1538818219-18141-1-git-send-email-lstipakov@gmail.com>
     URL: https://www.mail-archive.com/search?l=mid&q=1538818219-18141-1-git-send-email-lstipakov@gmail.com
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index b2ab2a6..9172dbb 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -613,26 +613,20 @@  uninit_proxy(struct context *c)
 }
 
 /*
- * Assign NCP-negotiable options to context->c1
- * from context->options (initially config values).
- * They persist over sigusr1 restart.
+ * Saves the initial state of NCP-regotiable
+ * options into a storage which persists over SIGUSR1.
  */
 static void
-do_set_ncp_options(struct context *c)
+save_ncp_options(struct context *c)
 {
     c->c1.ciphername = c->options.ciphername;
     c->c1.authname = c->options.authname;
     c->c1.keysize = c->options.keysize;
 }
 
-/*
- * Restore NCP-negotiable options from c->c1 to
- * c->options. The latter ones can be altered by
- * pushed options and therefore need to be restored
- * to original values on sigusr1 restart.
- */
+/* Restores NCP-negotiable options to original values */
 static void
-do_unset_ncp_options(struct context *c)
+restore_ncp_options(struct context *c)
 {
     c->options.ciphername = c->c1.ciphername;
     c->options.authname = c->c1.authname;
@@ -648,7 +642,7 @@  context_init_1(struct context *c)
 
     init_connection_list(c);
 
-    do_set_ncp_options(c);
+    save_ncp_options(c);
 
 #if defined(ENABLE_PKCS11)
     if (c->first_time)
@@ -4320,7 +4314,7 @@  close_instance(struct context *c)
         /* free key schedules */
         do_close_free_key_schedule(c, (c->mode == CM_P2P || c->mode == CM_TOP));
 
-        do_unset_ncp_options(c);
+        restore_ncp_options(c);
 
         /* close TCP/UDP connection */
         do_close_link_socket(c);