Browse code

init.c: refine functions names and description

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>
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>

Lev Stipakov authored on 2018/10/06 18:30:19
Showing 1 changed files
... ...
@@ -613,26 +613,20 @@ uninit_proxy(struct context *c)
613 613
 }
614 614
 
615 615
 /*
616
- * Assign NCP-negotiable options to context->c1
617
- * from context->options (initially config values).
618
- * They persist over sigusr1 restart.
616
+ * Saves the initial state of NCP-regotiable
617
+ * options into a storage which persists over SIGUSR1.
619 618
  */
620 619
 static void
621
-do_set_ncp_options(struct context *c)
620
+save_ncp_options(struct context *c)
622 621
 {
623 622
     c->c1.ciphername = c->options.ciphername;
624 623
     c->c1.authname = c->options.authname;
625 624
     c->c1.keysize = c->options.keysize;
626 625
 }
627 626
 
628
-/*
629
- * Restore NCP-negotiable options from c->c1 to
630
- * c->options. The latter ones can be altered by
631
- * pushed options and therefore need to be restored
632
- * to original values on sigusr1 restart.
633
- */
627
+/* Restores NCP-negotiable options to original values */
634 628
 static void
635
-do_unset_ncp_options(struct context *c)
629
+restore_ncp_options(struct context *c)
636 630
 {
637 631
     c->options.ciphername = c->c1.ciphername;
638 632
     c->options.authname = c->c1.authname;
... ...
@@ -648,7 +642,7 @@ context_init_1(struct context *c)
648 648
 
649 649
     init_connection_list(c);
650 650
 
651
-    do_set_ncp_options(c);
651
+    save_ncp_options(c);
652 652
 
653 653
 #if defined(ENABLE_PKCS11)
654 654
     if (c->first_time)
... ...
@@ -4320,7 +4314,7 @@ close_instance(struct context *c)
4320 4320
         /* free key schedules */
4321 4321
         do_close_free_key_schedule(c, (c->mode == CM_P2P || c->mode == CM_TOP));
4322 4322
 
4323
-        do_unset_ncp_options(c);
4323
+        restore_ncp_options(c);
4324 4324
 
4325 4325
         /* close TCP/UDP connection */
4326 4326
         do_close_link_socket(c);