From: "flichtenheld (Code Review)" Date: Thu, 28 Aug 2025 17:27:44 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="u51D/MTgeRM="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: socket_util: Clean up conversion warnings in add_in6_addr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --u51D/MTgeRM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1161?usp=3Demail to review the following change. Change subject: socket_util: Clean up conversion warnings in add_in6_addr ...................................................................... socket_util: Clean up conversion warnings in add_in6_addr Change-Id: Id3b8719ee6b457ce2d85156b39e0cea771a97e74 Signed-off-by: Frank Lichtenheld --- M src/openvpn/socket_util.c 1 file changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/1161/1 diff --git a/src/openvpn/socket_util.c b/src/openvpn/socket_util.c index 13f8c32..9b7312d 100644 --- a/src/openvpn/socket_util.c +++ b/src/openvpn/socket_util.c @@ -241,14 +241,12 @@ struct in6_addr add_in6_addr(struct in6_addr base, uint32_t add) { - int i; - - for (i =3D 15; i >=3D 0 && add > 0; i--) + for (int i =3D 15; i >=3D 0 && add > 0; i--) { - register int carry; + register uint32_t carry; register uint32_t h; - h =3D (unsigned char)base.s6_addr[i]; + h =3D base.s6_addr[i]; base.s6_addr[i] =3D (h + add) & UINT8_MAX; /* using explicit carry for the 8-bit additions will catch -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1161?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: Id3b8719ee6b457ce2d85156b39e0cea771a97e74 Gerrit-Change-Number: 1161 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --u51D/MTgeRM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

socket_util: Clean up conversion warnings in add_in6_addr
Change-Id: Id3b8719ee6b457ce2d85156b39e0cea771a97e74
Signed-off-by:= Frank Lichtenheld <frank@...2641...>
---
M src/openvpn/socket_= util.c
1 file changed, 3 insertions(+), 5 deletions(-)

git pul= l ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/1161/1
dif=
f --git a/src/openvpn/socket_util.c b/src/openvpn/socket_util.c
<= span>index 13f8c32..9b7312d 100644
--- a/src/openvpn/socket= _util.c
+++ b/src/openvpn/socket_util.c
@@ = -241,14 +241,12 @@
struct in6_addr
add_in= 6_addr(struct in6_addr base, uint32_t add)
{
- int i;
-
- for (i =3D 15; i >=3D 0 && add > 0; i--)+ for (int i =3D 15; i >= ;=3D 0 && add > 0; i--)
{
- register int carry;
<= span style=3D"color: hsl(120, 100%, 40%);">+ register uint32_t carry= ;
register uint32_t h;
- h =3D (unsigned char)ba= se.s6_addr[i];
+ = h =3D base.s6_addr[i];
base.s6_addr[i] =3D (h += add) & UINT8_MAX;

/* using = explicit carry for the 8-bit additions will catch

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id3b8719ee6b457ce2d85156b39e= 0cea771a97e74
Gerrit-Change-Number: 1161
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
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-MessageType: newchange
--u51D/MTgeRM=--