]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix some formatting related to if/else and macros
authorFrank Lichtenheld <frank@lichtenheld.com>
Thu, 5 Dec 2024 21:41:58 +0000 (22:41 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 6 Dec 2024 07:14:40 +0000 (08:14 +0100)
Make it clearer where the blocks are.

Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20241205214158.23542-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30027.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/helper.c
src/openvpn/manage.c
src/openvpn/openvpn.c
src/openvpn/route.c
src/openvpn/socket.c
src/openvpn/ssl.c

index bbdbc0413139e5bbd7e8ecfe06b7b63ebe877a62..9e28e87c4e01fa026a2b530762b0fe43330c7f4a 100644 (file)
@@ -500,7 +500,7 @@ helper_client_server(struct options *o)
             push_option(o, print_opt_route_gateway_dhcp(&o->gc), M_USAGE);
         }
     }
-    else
+
     /*
      * HELPER DIRECTIVE:
      *
@@ -511,7 +511,7 @@ helper_client_server(struct options *o)
      * pull
      * tls-client
      */
-    if (o->client)
+    else if (o->client)
     {
         o->pull = true;
         o->tls_client = true;
index f296788bef0f6f5b5fcfc759857334fd0bf45bdf..e79a1184c4ced443f324a3c16c46a2c28b7fa24e 100644 (file)
@@ -1822,7 +1822,9 @@ man_accept(struct management *man)
     }
     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 @@ man_connect(struct management *man)
         }
         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;
     }
index 1db5422446e41b2dd1c54bc8bd5a0f8719ccf3a4..c52540c25336dfc9b003c3d24fb4ca6878cf127c 100644 (file)
@@ -274,10 +274,10 @@ openvpn_main(int argc, char *argv[])
 
             /* 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)
index df06fdf7f59a797646472dc922477c657857f42d..d17b285f7ae6498212c04b79dc3a6054c0001b86 100644 (file)
@@ -3914,8 +3914,9 @@ get_default_gateway_ipv6(struct route_ipv6_gateway_info *rgi6,
         }
         else
 #endif
-
-        rgi6->gateway.addr_ipv6 = gw;
+        {
+            rgi6->gateway.addr_ipv6 = gw;
+        }
         rgi6->flags |= RGI_ADDR_DEFINED;
 
         if (ifp)
index efd742c60d7c69d4722495e65a5f68adecd4fcff..01874fe273eb8c598d5373240540f2bd8d0c0ff1 100644 (file)
@@ -3389,8 +3389,10 @@ link_socket_read_udp_posix(struct link_socket *sock,
     }
     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)
     {
index 1f8eb1ec7fe54b24c64f79a6fa9d510a9ea59565..33c22b4837343de0e6d60d783112f078b7914317 100644 (file)
@@ -327,7 +327,9 @@ auth_user_pass_setup(const char *auth_file, bool is_inline,
         }
         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);
+        }
     }
 }