From: "flichtenheld (Code Review)"
Date: Sun, 5 Apr 2026 20:39:35 +0000
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net
Message-ID:
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="j4jAg2m5Kps="; charset=UTF-8
Subject: [Openvpn-devel] [XS] Change in openvpn[master]: push: Make
prepare_push_reply return void
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: plaisthos
Cc: openvpn-devel
--j4jAg2m5Kps=
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/+/1616?usp=3Demail
to review the following change.
Change subject: push: Make prepare_push_reply return void
......................................................................
push: Make prepare_push_reply return void
It returned a constant value so it didn't actually
mean anything.
While here also make it static.
Identified by cppcheck.
Change-Id: Ied966413948cf3c935a8a1eb91172ef7a6948bdd
Signed-off-by: Frank Lichtenheld
---
M src/openvpn/push.c
1 file changed, 3 insertions(+), 6 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/16/1616/1
diff --git a/src/openvpn/push.c b/src/openvpn/push.c
index 835c433..564ce86 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -631,10 +631,8 @@
* @param c context structure storing data for VPN tunnel
* @param gc gc arena for allocating push options
* @param push_list push list to where options are added
- *
- * @return true on success, false on failure.
*/
-bool
+static void
prepare_push_reply(struct context *c, struct gc_arena *gc, struct push_lis=
t *push_list)
{
struct tls_multi *tls_multi =3D c->c2.tls_multi;
@@ -734,8 +732,6 @@
client_max_mtu, o->ce.tun_mtu, o->ce.tun_mtu);
}
}
-
- return true;
}
static bool
@@ -1011,7 +1007,8 @@
struct push_list push_list =3D { 0 };
struct gc_arena gc =3D gc_new();
- if (prepare_push_reply(c, &gc, &push_list) && send_push_reply(=
c, &push_list))
+ prepare_push_reply(c, &gc, &push_list);
+ if (send_push_reply(c, &push_list))
{
ret =3D PUSH_MSG_REQUEST;
c->c2.sent_push_reply_expiry =3D now + 30;
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1616?usp=3Demail
To unsubscribe, or for help writing mail filters, visit http://gerrit.openv=
pn.net/settings?usp=3Demail
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ied966413948cf3c935a8a1eb91172ef7a6948bdd
Gerrit-Change-Number: 1616
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
--j4jAg2m5Kps=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is cur=
rently required from: plaisthos.
flichtenheld would like plaisthos to review this change.
V=
iew Change
push: Make prepare_push_reply return void
It returned a constant value so it didn't actually
mean anythi=
ng.
While here also make it static.
Identified by cppcheck.
Change-Id: Ied966413948cf3c935a8a1eb91172ef7a6948bdd
Signed-off-by=
: Frank Lichtenheld <frank@...2641...>
---
M src/openvpn/push.c=
1 file changed, 3 insertions(+), 6 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/16/1616/1<=
/pre>diff --git a/src/openvpn/push.c b/src/openvpn/push.c
index 835c433..564ce86 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -631,10 +631,8 @@=
* @param c context structure storing data fo=
r VPN tunnel
* @param gc gc arena for allocati=
ng push options
* @param push_list push list to where=
options are added
- *<=
/span>
- * @return true on suc=
cess, false on failure.
*/
-bool
+static void
prepare_push_reply(struct context *c, =
struct gc_arena *gc, struct push_list *push_list)
{=
struct tls_multi *tls_multi =3D c->c2.tls_multi;@@ -734,8 +732,6 @@
client_max_mtu=
, o->ce.tun_mtu, o->ce.tun_mtu);
}
}
-<=
br>- return true;
}
static bool
@@ -1=
011,7 +1007,8 @@
struct push_list push_list =
=3D { 0 };
struct gc_arena gc =3D gc_new();
- =
if (prepare_push_reply(c, &gc, &push_list) && send_pu=
sh_reply(c, &push_list))
+ prepare_push_reply(c, &gc, &push_list);=
+ if (send_push_=
reply(c, &push_list))
{
=
ret =3D PUSH_MSG_REQUEST;
c=
->c2.sent_push_reply_expiry =3D now + 30;
To view, visit change 1616. To unsubscribe, or for help writing mail filt=
ers, visit setti=
ngs.
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ied966413948cf3c935a8a1eb911=
72ef7a6948bdd
Gerrit-Change-Number: 1616
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...>
=
--j4jAg2m5Kps=--