From: "plaisthos (Code Review)" Date: Tue, 26 Aug 2025 13:01:46 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <6ca06e826f5fcf2fc0cb7ac415ac1027ff2c5859-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="/saSNX7AQeQ="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: options: Introduce atoi_constrained and review usages of atoi_warn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --/saSNX7AQeQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c= /openvpn/+/1150?usp=3Demail ) Change subject: options: Introduce atoi_constrained and review usages of at= oi_warn ...................................................................... Patch Set 3: Code-Review-1 (2 comments) Patchset: PS3: I am not sure that the 0 as INT_MAX is the best way to go here. See the com= ment below. File src/openvpn/options_util.h: http://gerrit.openvpn.net/c/openvpn/+/1150/comment/8b3298f5_3710adb3 : PS3, Line 51: * If \p max is 0, \p INT_MAX is used instead. Why not use INT_MAX for INT_MAX and instead use this both 0 and INT_MAX are= INT_MAX? I think the code would be easier to parse from the calling functions if you= immediately see that it it is between whatever and INT_MAX. I think atoi_constrained(p[1], &cf_max, "connect-freq n", 1, INT_MAX, msglevel) is intuatively more clear than atoi_constrained(p[1], &cf_max, "connect-freq n", 1, 0, msglevel) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1150?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: Ibc7526d59c1de17a0f9d8ed88f75c6f070ab11e7 Gerrit-Change-Number: 1150 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Tue, 26 Aug 2025 13:01:46 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --/saSNX7AQeQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld.

Patch set 3:Code-Review -1=

V= iew Change

2 comments:

  • Patchset:

    • Patch Set #3:

      I am not sure that the 0 as INT_MAX is the = best way to go here. See the comment below.

  • File src/openvpn/options_util.h:

    • Patch Set #3, Line 51: * If \p max is 0, \p INT_MAX is = used instead.

      Why not use INT_MAX for INT_MAX and instead use this both 0 and INT= _MAX are INT_MAX?

      I think the code would be easier to parse from the calling functions i= f you immediately see that it it is between whatever and INT_MAX.

      I think

          atoi_cons=
      trained(p[1], &cf_max,  "connect-freq n", 1, INT_MAX, msgleve=
      l)

      is intua= tively more clear than

          atoi_constrained(p[1], &cf_max, "conne=
      ct-freq n", 1, 0, msglevel)

To view, visit= change = 1150. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ibc7526d59c1de17a0f9d8ed88f7= 5c6f070ab11e7
Gerrit-Change-Number: 1150
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Comment-Date: Tue, 26 Aug 2025 13:01:46= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--/saSNX7AQeQ=--