cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/821?usp=email )

Change subject: Fix some formatting related to if/else and macros
......................................................................

Fix some formatting related to if/else and macros

Make it clearer where the blocks are.

Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a
Signed-off-by: Frank Lichtenheld <fr...@lichtenheld.com>
Acked-by: Lev Stipakov <lstipa...@gmail.com>
Message-Id: <20241205214158.23542-1-g...@greenie.muc.de>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30027.html
Signed-off-by: Gert Doering <g...@greenie.muc.de>
---
M src/openvpn/helper.c
M src/openvpn/manage.c
M src/openvpn/openvpn.c
M src/openvpn/route.c
M src/openvpn/socket.c
M src/openvpn/ssl.c
6 files changed, 23 insertions(+), 14 deletions(-)




diff --git a/src/openvpn/helper.c b/src/openvpn/helper.c
index bbdbc04..9e28e87 100644
--- a/src/openvpn/helper.c
+++ b/src/openvpn/helper.c
@@ -500,7 +500,7 @@
             push_option(o, print_opt_route_gateway_dhcp(&o->gc), M_USAGE);
         }
     }
-    else
+
     /*
      * HELPER DIRECTIVE:
      *
@@ -511,7 +511,7 @@
      * pull
      * tls-client
      */
-    if (o->client)
+    else if (o->client)
     {
         o->pull = true;
         o->tls_client = true;
diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index f296788..e79a118 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -1822,7 +1822,9 @@
     }
     else
 #endif
-    man->connection.sd_cli = socket_do_accept(man->connection.sd_top, &act, 
false);
+    {
+        man->connection.sd_cli = socket_do_accept(man->connection.sd_top, 
&act, false);
+    }

     if (socket_defined(man->connection.sd_cli))
     {
@@ -1971,9 +1973,11 @@
         }
         else
 #endif
-        msg(D_LINK_ERRORS | M_ERRNO,
-            "MANAGEMENT: connect to %s failed",
-            print_sockaddr(man->settings.local->ai_addr, &gc));
+        {
+            msg(D_LINK_ERRORS | M_ERRNO,
+                "MANAGEMENT: connect to %s failed",
+                print_sockaddr(man->settings.local->ai_addr, &gc));
+        }
         throw_signal_soft(SIGTERM, "management-connect-failed");
         goto done;
     }
diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c
index 1db5422..c52540c 100644
--- a/src/openvpn/openvpn.c
+++ b/src/openvpn/openvpn.c
@@ -274,10 +274,10 @@

             /* Query passwords before becoming a daemon if we don't use the
              * management interface to get them. */
-#ifdef ENABLE_MANAGEMENT
             if (!(c.options.management_flags & MF_QUERY_PASSWORDS))
-#endif
-            init_query_passwords(&c);
+            {
+                init_query_passwords(&c);
+            }

             /* become a daemon if --daemon */
             if (c.first_time)
diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index df06fdf..d17b285 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -3914,8 +3914,9 @@
         }
         else
 #endif
-
-        rgi6->gateway.addr_ipv6 = gw;
+        {
+            rgi6->gateway.addr_ipv6 = gw;
+        }
         rgi6->flags |= RGI_ADDR_DEFINED;

         if (ifp)
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index efd742c..01874fe 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -3389,8 +3389,10 @@
     }
     else
 #endif
-    buf->len = recvfrom(sock->sd, BPTR(buf), buf_forward_capacity(buf), 0,
-                        &from->dest.addr.sa, &fromlen);
+    {
+        buf->len = recvfrom(sock->sd, BPTR(buf), buf_forward_capacity(buf), 0,
+                            &from->dest.addr.sa, &fromlen);
+    }
     /* FIXME: won't do anything when sock->info.af == AF_UNSPEC */
     if (buf->len >= 0 && expectedlen && fromlen != expectedlen)
     {
diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index 1f8eb1e..33c22b4 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -327,7 +327,9 @@
         }
         else
 #endif /* ifdef ENABLE_MANAGEMENT */
-        get_user_pass(&auth_user_pass, auth_file, UP_TYPE_AUTH, flags);
+        {
+            get_user_pass(&auth_user_pass, auth_file, UP_TYPE_AUTH, flags);
+        }
     }
 }


--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/821?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a
Gerrit-Change-Number: 821
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <fr...@lichtenheld.com>
Gerrit-Reviewer: plaisthos <arne-open...@rfc2549.org>
Gerrit-Reviewer: stipa <lstipa...@gmail.com>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-MessageType: merged
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to