Skip to content

Commit 84ef484

Browse files
flichtenheldcron2
authored andcommitted
socket_util: Clean up conversion warnings in add_in6_addr
Change-Id: Id3b8719ee6b457ce2d85156b39e0cea771a97e74 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20250831151259.25788-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32725.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
1 parent 10d64c1 commit 84ef484

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/openvpn/socket_util.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,12 @@ print_in_port_t(in_port_t port, struct gc_arena *gc)
241241
struct in6_addr
242242
add_in6_addr(struct in6_addr base, uint32_t add)
243243
{
244-
int i;
245-
246-
for (i = 15; i >= 0 && add > 0; i--)
244+
for (int i = 15; i >= 0 && add > 0; i--)
247245
{
248-
register int carry;
246+
register uint32_t carry;
249247
register uint32_t h;
250248

251-
h = (unsigned char)base.s6_addr[i];
249+
h = base.s6_addr[i];
252250
base.s6_addr[i] = (h + add) & UINT8_MAX;
253251

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

0 commit comments

Comments
 (0)