From: "flichtenheld (Code Review)" Date: Fri, 13 Feb 2026 18:54:59 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <70b4941ebec3313b8ef2a69f055569509180dbb9-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="u+Ykn141kHY="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: tun: Avoid sign-compare warning in header_modify_read_write_return List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --u+Ykn141kHY= 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/+/1527?usp=3Demail to review the following change. Change subject: tun: Avoid sign-compare warning in header_modify_read_write= _return ...................................................................... tun: Avoid sign-compare warning in header_modify_read_write_return Since we already check that the value is positive just make the implicit cast explicit. Change-Id: I2ca40d0d86599896b38ea1467313b6a6cdc8339c Signed-off-by: Frank Lichtenheld --- M src/openvpn/tun.c 1 file changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/1527/1 diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index a909e96..638611b 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1706,17 +1706,12 @@ #include #include -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - static inline ssize_t header_modify_read_write_return(ssize_t len) { if (len > 0) { - return len > sizeof(u_int32_t) ? len - sizeof(u_int32_t) : 0; + return (size_t)len > sizeof(u_int32_t) ? len - sizeof(u_int32_t) := 0; } else { @@ -1724,10 +1719,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static ssize_t write_tun_header(struct tuntap *tt, uint8_t *buf, int len) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1527?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I2ca40d0d86599896b38ea1467313b6a6cdc8339c Gerrit-Change-Number: 1527 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --u+Ykn141kHY= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

tun: Avoid sign-compare warning in header_m=
odify_read_write_return

Since we already check that the value is pos= itive
just make the implicit cast explicit.

Change-Id: I2ca40d0d8= 6599896b38ea1467313b6a6cdc8339c
Signed-off-by: Frank Lichtenheld <fra= nk@...2641...>
---
M src/openvpn/tun.c
1 file changed, 1 insert= ion(+), 10 deletions(-)

git pull ssh://gerrit.op=
envpn.net:29418/openvpn refs/changes/27/1527/1
diff --git a/src/ope=
nvpn/tun.c b/src/openvpn/tun.c
index a909e96..638611b 10064= 4
--- a/src/openvpn/tun.c
+++ b/src/openvpn= /tun.c
@@ -1706,17 +1706,12 @@
#include &l= t;netinet/ip.h>
#include <sys/uio.h>

-#if defined(__GN= UC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-compare"
-#endif
-
static inline ssize_t

header_modify_read_write_return(ssize_t len)
{
if (len > 0)
{
<= span style=3D"color: hsl(0, 100%, 40%);">- return len > sizeof(u_= int32_t) ? len - sizeof(u_int32_t) : 0;
+ return (size_t)len > sizeof(u_int32_t) ? len= - sizeof(u_int32_t) : 0;
}
else<= /span>
{
@@ -1724,10 +1719,6 @@
}

}

-#if defined(__GNUC__) || defined(__clang__)=
-#pragma GCC diagnostic pop
-#endif
-
static ssize_t

write_tun_header(struct tuntap *tt, uint8_t *buf, int len)
{

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2ca40d0d86599896b38ea146731= 3b6a6cdc8339c
Gerrit-Change-Number: 1527
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...>
= --u+Ykn141kHY=--