From: "flichtenheld (Code Review)" Date: Fri, 13 Sep 2024 13:57:21 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, ralf@...2726... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="u6+jhBfM9DQ="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: Support CIDR on options and extend netbits usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ralf_lici Cc: plaisthos , openvpn-devel --u6+jhBfM9DQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos, ralf_lici. flichtenheld has posted comments on this change. ( http://gerrit.openvpn.ne= t/c/openvpn/+/739?usp=3Demail ) Change subject: Support CIDR on options and extend netbits usage ...................................................................... Patch Set 3: Code-Review-2 (16 comments) Patchset: PS3: Didn't get through the whole code, but here a collection of my thoughts so = far... File doc/man-sections/server-options.rst: http://gerrit.openvpn.net/c/openvpn/+/739/comment/04a8784d_9d0d84d0 : PS3, Line 344: :code:`255.255.255.255`. for completeness mentions /32 as well. File doc/man-sections/vpn-network-options.rst: http://gerrit.openvpn.net/c/openvpn/+/739/comment/7f755556_b75a572a : PS3, Line 220: ifconfig local rn Need to specify the two possibilities (IP address or netmask) separately. Also "rn" is a horrible name. What it is supposed to mean? http://gerrit.openvpn.net/c/openvpn/+/739/comment/9e59c2d1_8882b7e2 : PS3, Line 266: 2 255 Add /bits example here? http://gerrit.openvpn.net/c/openvpn/+/739/comment/f33e5bdd_a494b3ca : PS3, Line 389: route network|ipv4addr [netmask] [gateway] [metric] Does the network|ipv4addr here really add any value? Should we go just for = ipv4addr here like with --route-ipv6 ? File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/739/comment/f3ac4520_d5a41ab2 : PS2, Line 1535: msg(D_SHOW_PARMS, " ifconfig_pool_start =3D %s/%d", pr= int_in_addr_t(o->ifconfig_pool_start, 0, &gc), o->ifconfig_pool_netbits); > ok Done File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/739/comment/483600ca_2e578b22 : PS3, Line 6103: if (!p[2]) /* p[1] must be in CIDR format */ Should probably do a ip_or_dns_addr_safe(p[1]) here? Might need to enhance = that function to allow netbits, though. http://gerrit.openvpn.net/c/openvpn/+/739/comment/37d80b88_d3071bd7 : PS3, Line 7029: VERIFY_PERMISSION VERIFY_PERMISSION should go first http://gerrit.openvpn.net/c/openvpn/+/739/comment/babf9754_f9b70e73 : PS3, Line 7037: if (cidr && !no_more_than_n_args(msglevel, p, 4, NM= _QUOTE_HINT)) Why NM_QUOTE_HINT? http://gerrit.openvpn.net/c/openvpn/+/739/comment/e96e9d33_aa4c39e3 : PS3, Line 7042: OPT_P_ROUTE VERIFY_PERMISSION should go first http://gerrit.openvpn.net/c/openvpn/+/739/comment/1c383a62_67435f56 : PS3, Line 7047: const char *network =3D strtok(p[i++], "/"); /*= this modifies p[1] */ I find this very ugly. Would be better if we could improve ip_or_dns_addr_s= afe to handle CIDR notation, wouldn't it? http://gerrit.openvpn.net/c/openvpn/+/739/comment/4bb91f0f_a5b37ba7 : PS3, Line 7071: add_route_to_option_list(options->routes, p[1],= NULL, p[2], p[3]); Should we consider already normalizing the route here already and not parse= the netmask vs netbits later _again_? But I have to confess I'm not sure w= hy we store the strings here in the first place and do not parse them alrea= dy, so I might be missing something. http://gerrit.openvpn.net/c/openvpn/+/739/comment/70b69c9f_0e173b5d : PS3, Line 7409: if (!no_more_than_n_args(msglevel, p, 3, NM_QUO= TE_HINT)) Why NM_QUOTE_HINT? http://gerrit.openvpn.net/c/openvpn/+/739/comment/eed071e7_4e1a613b : PS3, Line 7424: msg(M_USAGE, "--server directive network/ne= tmask combination is invalid"); Why does this have a separate error message here but not in the sameish cod= e in --server-bridge below? Can probably remove it here. http://gerrit.openvpn.net/c/openvpn/+/739/comment/ef3a007f_b7b2f353 : PS3, Line 7487: if (!no_more_than_n_args(msglevel, p, 4, NM_QUO= TE_HINT)) Why NM_QUOTE_HINT? Which argument could contain spaces? http://gerrit.openvpn.net/c/openvpn/+/739/comment/5a041385_78596de3 : PS3, Line 7898: if (!no_more_than_n_args(msglevel, p, 3, NM_QUO= TE_HINT)) Why NM_QUOTE_HINT? -- 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 Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Iae04ad8715e40dfc76475c2c5b9a766c9604efc9 Gerrit-Change-Number: 739 Gerrit-PatchSet: 3 Gerrit-Owner: ralf_lici Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: ralf_lici Gerrit-Comment-Date: Fri, 13 Sep 2024 13:57:21 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: flichtenheld Comment-In-Reply-To: ralf_lici Gerrit-MessageType: comment --u6+jhBfM9DQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos, ralf_lici.

Patch set 3:Code-Review -2=

Vi= ew Change

16 comments:

  • Patchset:

    • Patch Set #3:

      Didn't get through the whole code, but h= ere a collection of my thoughts so far...

  • File doc/man-sections/server-options.rst:

  • File doc/man-sections/vpn-network-options.rst:

    • Patch Set #3, Line 220: ifconfig local rn=

      Need to spec= ify the two possibilities (IP address or netmask) separately.
      Also "= ;rn" is a horrible name. What it is supposed to mean?

    • Patch Set #3, Line 266: 2 255

      Patch Set #3, Line 389: route network|ipv4addr [n= etmask] [gateway] [metric]

      Does the network|ipv4addr here really add any value? S= hould we go just for ipv4addr here like with --route-ipv6 ?

  • File src/openvpn/options.c:

    <= ul style=3D"list-style: none; padding: 0;">
  • Patch Set #2, Line 1535= : msg(D_SHOW_PARMS,= " ifconfig_pool_start =3D %s/%d", print_in_addr_t(o->ifconfi= g_pool_start, 0, &gc), o->ifconfig_pool_netbits);

    ok

    Done

  • File = src/openvpn/options.c:

  • To view, visit change 739. To unsubscribe, or f= or help writing mail filters, visit settings.

    Gerrit-Project: openvpn
    Gerrit-Branch: master
    Gerrit-Change-Id: Iae04ad8715e40dfc76475c2c5b9= a766c9604efc9
    Gerrit-Change-Number: 739
    Gerrit-PatchSet: 3
    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: ralf_lici <ralf@...2804...= .>
    Gerrit-Comment-Date: Fri, 13 Sep 2024 13:57:21= +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: flichtenheld <frank@...1186...= .2641...>
    Comment-In-Reply-To: ralf_lici <ralf@...2788...= 6...>
    Gerrit-MessageType: comment
    --u6+jhBfM9DQ=--