From: "flichtenheld (Code Review)" Date: Thu, 28 Nov 2024 12:04:52 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <1ac4bc9594683e61799818a8b3779e43f679368d-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="hhbCorQ3JQs="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Fix some formatting related to if/else and macros List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --hhbCorQ3JQs= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/821?usp=3Demail to review the following change. 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 --- M src/openvpn/helper.c M src/openvpn/manage.c M src/openvpn/openvpn.c 3 files changed, 13 insertions(+), 9 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/821/1 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 =3D true; o->tls_client =3D 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 =3D socket_do_accept(man->connection.sd_top, &a= ct, false); + { + man->connection.sd_cli =3D 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) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/821?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: If645c3faf149bac82167a91be13541b30a1b8d6a Gerrit-Change-Number: 821 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --hhbCorQ3JQs= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

Vi= ew Change

Fix some formatting related to if/else and macros

Make= it clearer where the blocks are.

Change-Id: If645c3faf149bac82167a9= 1be13541b30a1b8d6a
Signed-off-by: Frank Lichtenheld <frank@...2641...= >
---
M src/openvpn/helper.c
M src/openvpn/manage.c
M src/op= envpn/openvpn.c
3 files changed, 13 insertions(+), 9 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/821/1
diff --git a/src/openvpn/helper.c b/src/openvpn/helper.c
<= span>index bbdbc04..9e28e87 100644
--- a/src/openvpn/helper= .c
+++ b/src/openvpn/helper.c
@@ -500,7 +50= 0,7 @@
push_option(o, print_opt_route_gateway_= dhcp(&o->gc), M_USAGE);
}
= }
- else<= br>+
/*
* HELPER DIRECTIVE:
*
<= span>@@ -511,7 +511,7 @@

* pull
= * tls-client
*/
- if (o->client)
+ else if (o->client)
{=
o->pull =3D true;
o->tls_= client =3D true;
diff --git a/src/openvpn/manage.c b/src/op= envpn/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 =3D socket_do_accept(man->conne= ction.sd_top, &act, false);
+ {
+ = man->connection.sd_cli =3D socket_do_accept(man->connection.sd_= top, &act, false);
- m= sg(D_LINK_ERRORS | M_ERRNO,
- "MANAGEMENT: connect to %s failed",
<= span style=3D"color: hsl(0, 100%, 40%);">- print_sockaddr(man-&g= t;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-fail= ed");
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
@@ -2= 74,10 +274,10 @@

/* Query pa= sswords 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))<= br>-#endif
- init_query_passwords(&c);
+ {<= br>+ init_query_= passwords(&c);
+ = }

/* become a dae= mon if --daemon */
if (c.first_time)

To view, visit change 821. To unsubscribe, or for hel= p writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If645c3faf149bac82167a91be13= 541b30a1b8d6a
Gerrit-Change-Number: 821
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--hhbCorQ3JQs=--