From: "ralf_lici (Code Review)"
Date: Tue, 10 Mar 2026 09:53:10 +0000
In-Reply-To:
References:
Reply-To: ralf@...2726..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net, frank@...2641...
Message-ID: <624da500f4edcf1e8369be5d87ed8f0ec0a54c5e-EmailReviewComments-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="+xtCcyPGueU="; charset=UTF-8
Subject: [Openvpn-devel] [L] Change in openvpn[master]: options: add IPv4
CIDR parsing for relevant directives
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Cc: flichtenheld , plaisthos , openvpn-devel
--+xtCcyPGueU=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: flichtenheld, plaisthos.
ralf_lici has posted comments on this change by ralf_lici. ( http://gerrit.=
openvpn.net/c/openvpn/+/739?usp=3Demail )
Change subject: options: add IPv4 CIDR parsing for relevant directives
......................................................................
Patch Set 9:
(5 comments)
File doc/man-sections/server-options.rst:
http://gerrit.openvpn.net/c/openvpn/+/739/comment/93ccbb1c_e6347e78?usp=3De=
mail :
PS9, Line 309: view.
> I would find it a bit easier to read if this was more explicit. [=E2=80=
=A6]
Acknowledged
File src/openvpn/options.c:
http://gerrit.openvpn.net/c/openvpn/+/739/comment/bc6ae7da_894ede5f?usp=3De=
mail :
PS9, Line 7288: const int lev =3D M_WARN;
> Please fix to msglvl_t
Acknowledged
http://gerrit.openvpn.net/c/openvpn/+/739/comment/25bbf8a6_50aad5ce?usp=3De=
mail :
PS9, Line 7688: remote_netmask =3D getaddr(GETADDR_HOST_ORDER | GET=
ADDR_RESOLVE, ifconfig_push_parms[2], 0,
> A bit absurd that we need to parse netmask here again if we generated it =
before. [=E2=80=A6]
I agree. The main issue is that IPv4 options in options.c do not all conver=
t at the same stage: some paths keep parameters as strings until later cons=
umers, while others parse to binary earlier.
A dual-helper design (string + binary outputs) is possible, but it would ei=
ther duplicate per-option handling or require a broader parsing abstraction.
For this change, the scope is limited to translating CIDR-form IPv4 paramet=
er strings into the existing legacy string form, without altering downstrea=
m option processing.
File src/openvpn/options_util.c:
http://gerrit.openvpn.net/c/openvpn/+/739/comment/eb44c41a_68747e58?usp=3De=
mail :
PS9, Line 232: * socket_util.c dependencies into options_util unit-tes=
t targets. */
> This feels like a weak justification to duplicate code.
Just to make sure I understood this point correctly: do you prefer that I s=
witch to print_in_addr_t() (and pull in socket_util dependencies), or that =
I keep the local conversion and only tighten/remove the justification comme=
nt?
I tried the former locally: switching to print_in_addr_t() made options_par=
se_testdriver, push_update_msg_testdriver, and misc_testdriver fail to link=
unless socket_util.c is also linked. Once socket_util.c is linked, additio=
nal transitive symbols are required (setenv_*, siginfo_static/signal_reset,=
management_*), so this becomes a broader test/build refactor.
That's why for this patch I kept the conversion self-contained in options_u=
til.c.
File tests/unit_tests/openvpn/test_options_parse.c:
http://gerrit.openvpn.net/c/openvpn/+/739/comment/306d8e15_e3a09146?usp=3De=
mail :
PS9, Line 330: test_convert_ipv4_cidr_parms_coverage(void **state)
> This does not feel like it provides actual "coverage". The examples are a=
ll too similar. [=E2=80=A6]
Acknowledged
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/739?usp=3Demail
To unsubscribe, or for help writing mail filters, visit http://gerrit.openv=
pn.net/settings?usp=3Demail
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iae04ad8715e40dfc76475c2c5b9a766c9604efc9
Gerrit-Change-Number: 739
Gerrit-PatchSet: 9
Gerrit-Owner: ralf_lici
Gerrit-Reviewer: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
Gerrit-Attention: flichtenheld
Gerrit-Comment-Date: Tue, 10 Mar 2026 09:53:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld
--+xtCcyPGueU=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is cur=
rently required from: flichtenheld, plaisthos.
View C=
hange
5 comments:
Acknowledged
File src/openvpn/options.c:<=
/p>
Patch S=
et #9, Line 7288: =
const int lev =3D M_WARN;
Please fix to msglvl_t=
blockquote>Acknowledged
Patch Set #9, Lin=
e 7688: remote_=
netmask =3D getaddr(GETADDR_HOST_ORDER | GETADDR_RESOLVE, ifconfig_push_par=
ms[2], 0,
A bit absurd that we need to parse netmask =
here again if we generated it before. [=E2=80=A6]
I agree=
. The main issue is that IPv4 options in options.c do not all convert at th=
e same stage: some paths keep parameters as strings until later consumers, =
while others parse to binary earlier.
A dual-helper design (string + bin=
ary outputs) is possible, but it would either duplicate per-option handling=
or require a broader parsing abstraction.
For this change, the scope is=
limited to translating CIDR-form IPv4 parameter strings into the existing =
legacy string form, without altering downstream option processing.
=
File src/openvpn/options_=
util.c:
Patch Set #9, Line 232: * socket_util.c dependencies into options_util unit-test targets. */=
This feels like a weak justification to duplicate co=
de.
Just to make sure I understood this point correctly: d=
o you prefer that I switch to print_in_addr_t() (and pull in socket_util de=
pendencies), or that I keep the local conversion and only tighten/remove th=
e justification comment?
I tried the former locally: switching to print_=
in_addr_t() made options_parse_testdriver, push_update_msg_testdriver, and =
misc_testdriver fail to link unless socket_util.c is also linked. Once sock=
et_util.c is linked, additional transitive symbols are required (setenv_*, =
siginfo_static/signal_reset, management_*), so this becomes a broader test/=
build refactor.
That's why for this patch I kept the conversion self=
-contained in options_util.c.
File tests/unit_tests/openvpn/test_options_parse.c:
=
To view, visit change 739. To unsubscribe, or for help writing mail filters, vis=
it settings.=
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iae04ad8715e40dfc76475c2c5b9=
a766c9604efc9
Gerrit-Change-Number: 739
Gerrit-PatchSet: 9
Gerrit-Owner: ralf_lici <ralf@...2726...>=
;
Gerrit-Reviewer: flichtenheld <frank@...2716...=
1...>
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-Attention: flichtenheld <frank@...2375...=
41...>
Gerrit-Comment-Date: Tue, 10 Mar 2026 09:53:10=
+0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <frank@...1186...=
.2641...>
=
--+xtCcyPGueU=--