From: "flichtenheld (Code Review)" Date: Sun, 8 Oct 2023 10:44:02 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, gert@...1296... Message-ID: <009f59f26a01cb99650a08199e7ea7daab549fbb-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="gPmkDjmJzRM="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Change type of frame.mss_fix to uint16_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cron2 , openvpn-devel , plaisthos --gPmkDjmJzRM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, plaisthos. flichtenheld has posted comments on this change. ( http://gerrit.openvpn.ne= t/c/openvpn/+/268?usp=3Demail ) Change subject: Change type of frame.mss_fix to uint16_t ...................................................................... Patch Set 4: (2 comments) File src/openvpn/mss.c: http://gerrit.openvpn.net/c/openvpn/+/268/comment/e08cbc9f_bc6cb983 : PS3, Line 195: mssval +=3D opt[3]; > why is this change needed? This fixes a conversion warning: ../../../src/openvpn/mss.c:196:26: warning: conversion from =E2=80=98int=E2=80=99 to =E2=80=98uint16_t=E2=80=99 {aka = =E2=80=98short unsigned int=E2=80=99} may change value [-Wconversion] 196 | mssval =3D (opt[2] << 8) + opt[3]; | ^ So basically the compiler goes up to int and then realizes it needs to go back down to uint16_t. By splitting the statement this is avoided. One could also fix that with casts, but that would be much uglier, IMHO. File src/openvpn/options.c: http://gerrit.openvpn.net/c/openvpn/+/268/comment/d77550a7_9c8eca27 : PS3, Line 7257: if (mssfix > UINT16_MAX) > If we introduce a check here, we should also ensure a minimum value - we = assign `ce. [=E2=80=A6] Done -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/268?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: Id8321dfbb8ad8d79f4bb2a9da61f8cd6b6c6ee26 Gerrit-Change-Number: 268 Gerrit-PatchSet: 4 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Comment-Date: Sun, 08 Oct 2023 10:44:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: cron2 Gerrit-MessageType: comment --gPmkDjmJzRM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: cron2, plaisthos.

View C= hange

2 comments:

    =
  • File src/openvpn/mss.c:

    • Patch Set #3, Line 195: mssval +=3D o= pt[3];

      why is this change needed?

      This f= ixes a conversion warning:
      ../../../src/openvpn/mss.c:196:26: warning:conversion from =E2=80=98int=E2=80=99 to =E2=80=98uint16_t=E2=80=99 {aka = =E2=80=98short unsigned int=E2=80=99} may change value [-Wconversion]
      = 196 | mssval =3D (opt[2] << 8) + opt[3];
      | = ^

      So basically the compiler goes up to int and then realizes i= t needs
      to go back down to uint16_t. By splitting the statement this is = avoided.

      One = could also fix that with casts, but that would be much uglier, IMHO.

  • File src/openvpn/option= s.c:

    • Patch Set #3, = Line 7257: = if (mssfix > UINT16_MAX)

      If we introduce a check h= ere, we should also ensure a minimum value - we assign `ce. [=E2=80=A6]

      Don= e

To view, visit change 268. To unsubscribe, or for he= lp writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id8321dfbb8ad8d79f4bb2a9da61= f8cd6b6c6ee26
Gerrit-Change-Number: 268
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
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: cron2 <gert@...1296...>= ;
Gerrit-Comment-Date: Sun, 08 Oct 2023 10:44:02= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <gert@...1296...= >
Gerrit-MessageType: comment
--gPmkDjmJzRM=--