From: "mrbff (Code Review)"
Date: Thu, 24 Jul 2025 08:21:03 +0000
In-Reply-To:
References:
Reply-To: marco@...2726..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net, frank@...2641...,
lstipakov@...277..., gert@...1296...
Message-ID:
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="0CYmKiTrKRs="; charset=UTF-8
Subject: [Openvpn-devel] [L] Change in openvpn[master]: PUSH_UPDATE message
sender: enabling the server to send PUSH_UPDATE c...
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Cc: flichtenheld , stipa , plaisthos , openvpn-devel
--0CYmKiTrKRs=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: cron2, flichtenheld, plaisthos, stipa.
mrbff has posted comments on this change. ( http://gerrit.openvpn.net/c/ope=
nvpn/+/869?usp=3Demail )
Change subject: PUSH_UPDATE message sender: enabling the server to send PUS=
H_UPDATE control messages
......................................................................
Patch Set 17:
(12 comments)
File doc/management-notes.txt:
http://gerrit.openvpn.net/c/openvpn/+/869/comment/33d4ba61_04cc0d55 :
PS16, Line 1075:
> I do question whether this is a reasonable approach, to have "by cn" and =
"by addr" functions, that a [=E2=80=A6]
i mostly followed the `kill` command, but yes it is the second one.
File src/openvpn/manage.c:
http://gerrit.openvpn.net/c/openvpn/+/869/comment/183ce8a9_448ff5ac :
PS16, Line 1362: }
> I bet there are more elegant and less repetitive ways to do 4 different `=
if (status) print(SUCCESS!) [=E2=80=A6]
Done
File src/openvpn/push.h:
http://gerrit.openvpn.net/c/openvpn/+/869/comment/940bc697_89ca7f9f :
PS16, Line 54:
> This does confuse me a bit. [=E2=80=A6]
you can get the cid only from management, but theoretically the rest could =
be used by other functions in the future
File src/openvpn/push_util.c:
http://gerrit.openvpn.net/c/openvpn/+/869/comment/ccbe9b3d_34774f2d :
PS16, Line 66: /* Allocate memory and asseble the final message */
> typo
Done
http://gerrit.openvpn.net/c/openvpn/+/869/comment/a9514c2d_3d9f4c1f :
PS16, Line 82: }
> it might increase readability to juse use `snprintf( ... [=E2=80=A6]
Done
http://gerrit.openvpn.net/c/openvpn/+/869/comment/bc395641_798e9979 :
PS16, Line 122: msgs[im] =3D forge_msg(str, ",push-continuation=
2", gc);
> I do wonder if this can be done without modifying the string, so getting =
rid of the `strdup()` requi [=E2=80=A6]
Acknowledged
http://gerrit.openvpn.net/c/openvpn/+/869/comment/9e0a4d3f_be2fdaaa :
PS16, Line 143: /* It actually send the already divided messagge to one sin=
gle client */
> This comment needs a visit from the grammar police ;-) [=E2=80=A6]
Done
http://gerrit.openvpn.net/c/openvpn/+/869/comment/c617f505_475db955 :
PS16, Line 158: buf_write(&buf, msgs[i], strlen(msgs[i]));
> If you want to have the message in a `buf` here, you could have `forge_ms=
g()` just use `buf_printf() [=E2=80=A6]
ok, working on it
http://gerrit.openvpn.net/c/openvpn/+/869/comment/ac640134_01fb9aae :
PS16, Line 165: /* After sending the control message, we update the=
options server-side in the client's context */
> Can you extend the comment a bit on why this is needed? I assume (which =
might or might not be a bad [=E2=80=A6]
Done
http://gerrit.openvpn.net/c/openvpn/+/869/comment/7a73548b_cfd887a6 :
PS16, Line 204: if (!message_splitter(gc_strdup(msg, &gc), msgs, &gc, s=
afe_cap))
> Please do not call `strdup()` in a function call... [=E2=80=A6]
Done
http://gerrit.openvpn.net/c/openvpn/+/869/comment/4e68ba97_68899c76 :
PS16, Line 239:
> how can we ever end here if ENABLE_MANAGEMENT is not defined? Except for=
the unit test, there is no [=E2=80=A6]
We can't now, yes, but the function could be used somewhere else in the fut=
ure
http://gerrit.openvpn.net/c/openvpn/+/869/comment/d6fc2d7c_558c5256 :
PS16, Line 305: RETURN_UPDATE_STATUS(n_sent);
> so here we have this nice if/else macro that manage.c could use :-)... [=
=E2=80=A6]
i need to do the lookup anyway in send_push_update(), so it would duplicate=
code with no good reason i think, but i can use the macro anyway, np
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/869?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: Ie82bcc7a8e583de9156b185d71d1a323ed8df3fc
Gerrit-Change-Number: 869
Gerrit-PatchSet: 17
Gerrit-Owner: mrbff
Gerrit-Reviewer: cron2
Gerrit-Reviewer: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-Reviewer: stipa
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
Gerrit-Attention: cron2
Gerrit-Attention: flichtenheld
Gerrit-Attention: stipa
Gerrit-Comment-Date: Thu, 24 Jul 2025 08:21:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2
Gerrit-MessageType: comment
--0CYmKiTrKRs=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: cron2, flichtenheld, plaisthos, s=
tipa.
View C=
hange
12 comments:
you can get the cid only from management, but th=
eoretically the rest could be used by other functions in the future
File src/openvpn/push_ut=
il.c:
Patch Set #16=
, Line 66: /* Allocate =
memory and asseble the final message */
typoDone
=
Patch Set #16, Line 82: }
it might increase readability to=
juse use `snprintf( ... [=E2=80=A6]
Done
Patch Set #16, L=
ine 122: ms=
gs[im] =3D forge_msg(str, ",push-continuation 2", gc);
=
I do wonder if this can be done without modifying the string, s=
o getting rid of the `strdup()` requi [=E2=80=A6]
Acknowledged
Patch Set #16, Line 143: /* It actually send the already divided messagge to one single clie=
nt */
This comment needs a visit from the grammar pol=
ice ;-) [=E2=80=A6]
Done
Patch Set #16, Line 158: buf_write(&buf, msg=
s[i], strlen(msgs[i]));
If you want to have the messa=
ge in a `buf` here, you could have `forge_msg()` just use `buf_printf() [=
=E2=80=A6]
ok, working on it
Patch Set #16, Line 165: =
/* After sending th=
e control message, we update the options server-side in the client's co=
ntext */
Can you extend the comment a bit on why this=
is needed? I assume (which might or might not be a bad [=E2=80=A6]Done=
p>
Patch Set #16, Line 204: if (!message_splitter(gc_strdup(msg, &gc), msgs, =
&gc, safe_cap))
Please do not call `strdup()` in =
a function call... [=E2=80=A6]
Done
Patch Set #16, Line 23=
9:
how can we ever end here if ENABLE_MANAGEMENT is not defined? Except fo=
r the unit test, there is no [=E2=80=A6]
We can't now, yes, but the fun=
ction could be used somewhere else in the future
Patch Set=
#16, Line 305: RET=
URN_UPDATE_STATUS(n_sent);
so here we have this nice =
if/else macro that manage.c could use :-)... [=E2=80=A6]
i need to do the l=
ookup anyway in send_push_update(), so it would duplicate code with no good=
reason i think, but i can use the macro anyway, np
=
To view, visit change 869. To unsubscribe, or for help writing mail filters,=
visit settings.
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie82bcc7a8e583de9156b185d71d=
1a323ed8df3fc
Gerrit-Change-Number: 869
Gerrit-PatchSet: 17
Gerrit-Owner: mrbff <marco@...2726...> <=
/div>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...=
1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...=
.1227...>
Gerrit-Reviewer: stipa <lstipakov@...277...=
>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...=
ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...=
..1227...>
Gerrit-Attention: cron2 <gert@...1296...>=
;
Gerrit-Attention: flichtenheld <frank@...2375...=
41...>
Gerrit-Attention: stipa <lstipakov@...1663...=
.>
Gerrit-Comment-Date: Thu, 24 Jul 2025 08:21:03=
+0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <gert@...1296...=
>
Gerrit-MessageType: comment
--0CYmKiTrKRs=--