From: "cron2 (Code Review)" Date: Fri, 19 Sep 2025 16:42:56 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="/0KcPyNQApA="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --/0KcPyNQApA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/11= 31?usp=3Demail ) Change subject: socket: Change resolve flags to unsigned int ...................................................................... socket: Change resolve flags to unsigned int And use them consistently so to avoid conversion warnings. Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1131 Message-Id: <20250919154040.17684-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33= 098.html Signed-off-by: Gert Doering --- M src/openvpn/socket.c M src/openvpn/socket.h M src/openvpn/socket_util.h 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index eeb42d1..afedf5d 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -246,10 +246,10 @@ */ static int get_cached_dns_entry(struct cached_dns_entry *dns_cache, const char *hostn= ame, const char *servname, - int ai_family, int resolve_flags, struct addrinfo **a= i) + int ai_family, unsigned int resolve_flags, struct add= rinfo **ai) { struct cached_dns_entry *ph; - int flags; + unsigned int flags; /* Only use flags that are relevant for the structure */ flags =3D resolve_flags & GETADDR_CACHE_MASK; @@ -269,7 +269,7 @@ static int do_preresolve_host(struct context *c, const char *hostname, const char *se= rvname, const int af, - const int flags) + const unsigned int flags) { struct addrinfo *ai; int status; @@ -323,7 +323,7 @@ { int status; const char *remote; - int flags =3D preresolve_flags; + unsigned int flags =3D preresolve_flags; struct connection_entry *ce =3D l->array[i]; @@ -1186,7 +1186,7 @@ /* resolve local address if undefined */ if (!sock->info.lsa->bind_local) { - int flags =3D GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_F= ATAL | GETADDR_PASSIVE; + unsigned int flags =3D GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | = GETADDR_FATAL | GETADDR_PASSIVE; int status; if (proto_is_dgram(sock->info.proto)) diff --git a/src/openvpn/socket.h b/src/openvpn/socket.h index cce9183..e45981f 100644 --- a/src/openvpn/socket.h +++ b/src/openvpn/socket.h @@ -67,7 +67,7 @@ const char *hostname; const char *servname; int ai_family; - int flags; + unsigned int flags; struct addrinfo *ai; struct cached_dns_entry *next; }; diff --git a/src/openvpn/socket_util.h b/src/openvpn/socket_util.h index ada52a4..f3dfd22 100644 --- a/src/openvpn/socket_util.h +++ b/src/openvpn/socket_util.h @@ -114,18 +114,18 @@ * DNS resolution */ -#define GETADDR_RESOLVE (1 << 0) -#define GETADDR_FATAL (1 << 1) -#define GETADDR_HOST_ORDER (1 << 2) -#define GETADDR_MENTION_RESOLVE_RETRY (1 << 3) -#define GETADDR_FATAL_ON_SIGNAL (1 << 4) -#define GETADDR_WARN_ON_SIGNAL (1 << 5) -#define GETADDR_MSG_VIRT_OUT (1 << 6) -#define GETADDR_TRY_ONCE (1 << 7) -#define GETADDR_UPDATE_MANAGEMENT_STATE (1 << 8) -#define GETADDR_RANDOMIZE (1 << 9) -#define GETADDR_PASSIVE (1 << 10) -#define GETADDR_DATAGRAM (1 << 11) +#define GETADDR_RESOLVE (1u << 0) +#define GETADDR_FATAL (1u << 1) +#define GETADDR_HOST_ORDER (1u << 2) +#define GETADDR_MENTION_RESOLVE_RETRY (1u << 3) +#define GETADDR_FATAL_ON_SIGNAL (1u << 4) +#define GETADDR_WARN_ON_SIGNAL (1u << 5) +#define GETADDR_MSG_VIRT_OUT (1u << 6) +#define GETADDR_TRY_ONCE (1u << 7) +#define GETADDR_UPDATE_MANAGEMENT_STATE (1u << 8) +#define GETADDR_RANDOMIZE (1u << 9) +#define GETADDR_PASSIVE (1u << 10) +#define GETADDR_DATAGRAM (1u << 11) #define GETADDR_CACHE_MASK (GETADDR_DATAGRAM | GETADDR_PASSIVE) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1131?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: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92 Gerrit-Change-Number: 1131 Gerrit-PatchSet: 7 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --/0KcPyNQApA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

socket: Change resolve flags to unsigned int<=
br>
And use them consistently so to avoid conversion
warnings.
Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92
Signed-off-by: Fra= nk Lichtenheld <frank@...2641...>
Acked-by: Gert Doering <gert@= ...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1131Message-Id: <20250919154040.17684-1-gert@...1296...>
URL: https:= //www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33098.htmlSigned-off-by: Gert Doering <gert@...1296...>
---
M src/openvp= n/socket.c
M src/openvpn/socket.h
M src/openvpn/socket_util.h
3 fi= les changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index eeb42d1..afedf5d 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -246,10 +246,1= 0 @@
*/
static int
get_= cached_dns_entry(struct cached_dns_entry *dns_cache, const char *hostname, = const char *servname,
-= int ai_family, int resolve_flags, struct addrinfo **ai= )
+ = int ai_family, unsigned int resolve_flags, struct addrinfo **ai)<= br> {
struct cached_dns_entry *ph;
- int flags;

+ unsigned int flags;
=
/* Only use flags that are relevant for the structur= e */
flags =3D resolve_flags & GETADDR_CACHE_MASK;=
@@ -269,7 +269,7 @@

sta= tic int
do_preresolve_host(struct context *c, const char *= hostname, const char *servname, const int af,
- const int flags)
+ const unsigned i= nt flags)
{
struct addrinfo *ai;
int status;
@@ -323,7 +323,7 @@
= {
int status;
= const char *remote;
- = int flags =3D preresolve_flags;
+ unsigned int flags =3D preresolve_flags;
struct connection_entry *ce =3D l->ar= ray[i];

@@ -1186,7 +1186,7 @@
<= span> /* resolve local address if undefined */

if = (!sock->info.lsa->bind_local)
{
- int flags =3D GETADDR_RESOLVE = | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE;
+ unsigned int flags =3D GETA= DDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE;

int status;

= if (proto_is_dgram(sock->info.proto))
diff --git a/src= /openvpn/socket.h b/src/openvpn/socket.h
index cce9183..e45= 981f 100644
--- a/src/openvpn/socket.h
+++ = b/src/openvpn/socket.h
@@ -67,7 +67,7 @@
= const char *hostname;
const char *servname;<= br> int ai_family;
- int flags;
+ unsigned int flags;
struct addrinfo *ai;<= br> struct cached_dns_entry *next;
};
= diff --git a/src/openvpn/socket_util.h b/src/openvpn/socket_util.h
index ada52a4..f3dfd22 100644
--- a/src/openv= pn/socket_util.h
+++ b/src/openvpn/socket_util.h
= @@ -114,18 +114,18 @@
* DNS resolution
*/


-#define GETADDR_RESOLVE (1 << 0)
-#define GETADDR_FATAL = (1 << 1)
-#def= ine GETADDR_HOST_ORDER (1 << 2)
-#define GETADDR_MENTION_RESOLVE_RETRY (1 <= ;< 3)
-#define GETAD= DR_FATAL_ON_SIGNAL (1 << 4)
-#define GETADDR_WARN_ON_SIGNAL (1 << 5)<= /span>
-#define GETADDR_MSG_VI= RT_OUT (1 << 6)
-#define GETADDR_TRY_ONCE (1 << 7)-#define GETADDR_UPDATE_MANAGEME= NT_STATE (1 << 8)
-#define GETADDR_RANDOMIZE (1 << 9)
-#define GETADDR_PASSIVE = (1 << 10)
-#defin= e GETADDR_DATAGRAM (1 << 11)
+#define GETADDR_RESOLVE (1u &= lt;< 0)
+#define G= ETADDR_FATAL (1u << 1)
+#define GETADDR_HOST_ORDER (1u <= < 2)
+#define GETA= DDR_MENTION_RESOLVE_RETRY (1u << 3)
+#define GETADDR_FATAL_ON_SIGNAL (1u <<= ; 4)
+#define GETADDR= _WARN_ON_SIGNAL (1u << 5)
+#define GETADDR_MSG_VIRT_OUT (1u << 6= )
+#define GETADDR_TR= Y_ONCE (1u << 7)
+#define GETADDR_UPDATE_MANAGEMENT_STATE (1u << 8)
+#define GETADDR_RANDO= MIZE (1u << 9)
+#define GETADDR_PASSIVE (1u << 10)
+#define GETADDR_DATAGRA= M (1u << 11)

#defin= e GETADDR_CACHE_MASK (GETADDR_DATAGRAM | GETADDR_PASSIVE)
=

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ef21e425786a49c90d4b7305c3= fb174ab6ddf92
Gerrit-Change-Number: 1131
Gerrit-PatchSet: 7
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-MessageType: merged
--/0KcPyNQApA=--