All of lore.kernel.org
 help / color / mirror / Atom feed
* [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int
       [not found] <gerrit.1754490554000.I5ef21e425786a49c90d4b7305c3fb174ab6ddf92@...2715...>
@ 2025-08-06 14:29 ` flichtenheld (Code Review)
  2025-09-01 15:09 ` flichtenheld (Code Review)
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: flichtenheld (Code Review) @ 2025-08-06 14:29 UTC (permalink / raw)
  To: plaisthos <arne-openvpn@; +Cc: openvpn-devel

[-- Attachment #1: Type: text/plain, Size: 4596 bytes --]

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/+/1131?usp=email

to review the following change.


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 <frank@...2641...>
---
M src/openvpn/socket.c
M src/openvpn/socket.h
2 files changed, 18 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/1131/1

diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index b0a158b..4019c1e 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 *hostname, const char *servname,
-                     int ai_family, int resolve_flags, struct addrinfo **ai)
+                     int ai_family, unsigned int resolve_flags, struct addrinfo **ai)
 {
     struct cached_dns_entry *ph;
-    int flags;
+    unsigned int flags;

     /* Only use flags that are relevant for the structure */
     flags = resolve_flags & GETADDR_CACHE_MASK;
@@ -269,7 +269,7 @@
 
 static int
 do_preresolve_host(struct context *c, const char *hostname, const char *servname, 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 = preresolve_flags;
+        unsigned int flags = preresolve_flags;

         struct connection_entry *ce = l->array[i];

@@ -1608,7 +1608,7 @@
     /* resolve local address if undefined */
     if (!sock->info.lsa->bind_local)
     {
-        int flags = GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE;
+        unsigned int flags = 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 c34c65a..3b82dac 100644
--- a/src/openvpn/socket.h
+++ b/src/openvpn/socket.h
@@ -78,7 +78,7 @@
     const char *hostname;
     const char *servname;
     int ai_family;
-    int flags;
+    unsigned int flags;
     struct addrinfo *ai;
     struct cached_dns_entry *next;
 };
@@ -476,18 +476,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=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92
Gerrit-Change-Number: 1131
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2641...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...1227...>
Gerrit-MessageType: newchange

[-- Attachment #2: Type: text/html, Size: 8188 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int
       [not found] <gerrit.1754490554000.I5ef21e425786a49c90d4b7305c3fb174ab6ddf92@...2715...>
  2025-08-06 14:29 ` [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int flichtenheld (Code Review)
@ 2025-09-01 15:09 ` flichtenheld (Code Review)
  2025-09-19 15:40 ` cron2 (Code Review)
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: flichtenheld (Code Review) @ 2025-09-01 15:09 UTC (permalink / raw)
  To: plaisthos <arne-openvpn@; +Cc: openvpn-devel

[-- Attachment #1: Type: text/plain, Size: 4793 bytes --]

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1131?usp=email

to look at the new patch set (#6).


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 <frank@...2641...>
---
M src/openvpn/socket.c
M src/openvpn/socket.h
M src/openvpn/socket_util.h
3 files changed, 18 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/1131/6

diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index 306170c..e362e5e 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -245,10 +245,10 @@
  */
 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)
 {
     struct cached_dns_entry *ph;
-    int flags;
+    unsigned int flags;

     /* Only use flags that are relevant for the structure */
     flags = resolve_flags & GETADDR_CACHE_MASK;
@@ -268,7 +268,7 @@

 static int
 do_preresolve_host(struct context *c, const char *hostname, const char *servname, const int af,
-                   const int flags)
+                   const unsigned int flags)
 {
     struct addrinfo *ai;
     int status;
@@ -322,7 +322,7 @@
     {
         int status;
         const char *remote;
-        int flags = preresolve_flags;
+        unsigned int flags = preresolve_flags;

         struct connection_entry *ce = l->array[i];

@@ -1185,7 +1185,7 @@
     /* resolve local address if undefined */
     if (!sock->info.lsa->bind_local)
     {
-        int flags = GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE;
+        unsigned int flags = 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 5ea37dd..801fbfa 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=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92
Gerrit-Change-Number: 1131
Gerrit-PatchSet: 6
Gerrit-Owner: flichtenheld <frank@...2641...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...1227...>
Gerrit-MessageType: newpatchset

[-- Attachment #2: Type: text/html, Size: 8438 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int
       [not found] <gerrit.1754490554000.I5ef21e425786a49c90d4b7305c3fb174ab6ddf92@...2715...>
  2025-08-06 14:29 ` [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int flichtenheld (Code Review)
  2025-09-01 15:09 ` flichtenheld (Code Review)
@ 2025-09-19 15:40 ` cron2 (Code Review)
  2025-09-19 15:40 ` [Openvpn-devel] [PATCH v6] " Gert Doering
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cron2 (Code Review) @ 2025-09-19 15:40 UTC (permalink / raw)
  To: flichtenheld <frank@; +Cc: plaisthos <arne-openvpn@

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1131?usp=email )

Change subject: socket: Change resolve flags to unsigned int
......................................................................


Patch Set 6: Code-Review+2


--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1131?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92
Gerrit-Change-Number: 1131
Gerrit-PatchSet: 6
Gerrit-Owner: flichtenheld <frank@...2641...>
Gerrit-Reviewer: cron2 <gert@...1296...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...1227...>
Gerrit-Attention: flichtenheld <frank@...2641...>
Gerrit-Comment-Date: Fri, 19 Sep 2025 15:40:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

[-- Attachment #2: Type: text/html, Size: 2024 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Openvpn-devel] [PATCH v6] socket: Change resolve flags to unsigned int
       [not found] <gerrit.1754490554000.I5ef21e425786a49c90d4b7305c3fb174ab6ddf92@...2715...>
                   ` (2 preceding siblings ...)
  2025-09-19 15:40 ` cron2 (Code Review)
@ 2025-09-19 15:40 ` Gert Doering
  2025-09-19 16:42   ` [Openvpn-devel] [PATCH applied] " Gert Doering
  2025-09-19 16:42 ` [Openvpn-devel] [S] Change in openvpn[master]: " cron2 (Code Review)
  2025-09-19 16:42 ` cron2 (Code Review)
  5 siblings, 1 reply; 7+ messages in thread
From: Gert Doering @ 2025-09-19 15:40 UTC (permalink / raw)
  To: openvpn-devel

From: Frank Lichtenheld <frank@...2641...>

And use them consistently so to avoid conversion
warnings.

Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92
Signed-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Gert Doering <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1131
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1131
This mail reflects revision 6 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@...1296...>

        
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index 306170c..e362e5e 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -245,10 +245,10 @@
  */
 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)
 {
     struct cached_dns_entry *ph;
-    int flags;
+    unsigned int flags;
 
     /* Only use flags that are relevant for the structure */
     flags = resolve_flags & GETADDR_CACHE_MASK;
@@ -268,7 +268,7 @@
 
 static int
 do_preresolve_host(struct context *c, const char *hostname, const char *servname, const int af,
-                   const int flags)
+                   const unsigned int flags)
 {
     struct addrinfo *ai;
     int status;
@@ -322,7 +322,7 @@
     {
         int status;
         const char *remote;
-        int flags = preresolve_flags;
+        unsigned int flags = preresolve_flags;
 
         struct connection_entry *ce = l->array[i];
 
@@ -1185,7 +1185,7 @@
     /* resolve local address if undefined */
     if (!sock->info.lsa->bind_local)
     {
-        int flags = GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE;
+        unsigned int flags = 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 5ea37dd..801fbfa 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)
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Openvpn-devel] [PATCH applied] Re: socket: Change resolve flags to unsigned int
  2025-09-19 15:40 ` [Openvpn-devel] [PATCH v6] " Gert Doering
@ 2025-09-19 16:42   ` Gert Doering
  0 siblings, 0 replies; 7+ messages in thread
From: Gert Doering @ 2025-09-19 16:42 UTC (permalink / raw)
  To: Frank Lichtenheld <frank@; +Cc: openvpn-devel

Straightforward, stared a bit at the code, and BB confirms that nothing
breaks...  (not that our test rig is excercising these party really hard).

Your patch has been applied to the master branch.

commit 5b7fde23af6e06c90a56100e4bec91132617e327
Author: Frank Lichtenheld
Date:   Fri Sep 19 17:40:34 2025 +0200

     socket: Change resolve flags to unsigned int

     Signed-off-by: Frank Lichtenheld <frank@...2641...>
     Acked-by: Gert Doering <gert@...1296...>
     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/msg33098.html
     Signed-off-by: Gert Doering <gert@...1296...>


--
kind regards,

Gert Doering



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int
       [not found] <gerrit.1754490554000.I5ef21e425786a49c90d4b7305c3fb174ab6ddf92@...2715...>
                   ` (3 preceding siblings ...)
  2025-09-19 15:40 ` [Openvpn-devel] [PATCH v6] " Gert Doering
@ 2025-09-19 16:42 ` cron2 (Code Review)
  2025-09-19 16:42 ` cron2 (Code Review)
  5 siblings, 0 replies; 7+ messages in thread
From: cron2 (Code Review) @ 2025-09-19 16:42 UTC (permalink / raw)
  To: flichtenheld <frank@; +Cc: openvpn-devel

[-- Attachment #1: Type: text/plain, Size: 5075 bytes --]

cron2 has uploaded a new patch set (#7) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1131?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2


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 <frank@...2641...>
Acked-by: Gert Doering <gert@...1296...>
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/msg33098.html
Signed-off-by: Gert Doering <gert@...1296...>
---
M src/openvpn/socket.c
M src/openvpn/socket.h
M src/openvpn/socket_util.h
3 files changed, 18 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/1131/7

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 *hostname, const char *servname,
-                     int ai_family, int resolve_flags, struct addrinfo **ai)
+                     int ai_family, unsigned int resolve_flags, struct addrinfo **ai)
 {
     struct cached_dns_entry *ph;
-    int flags;
+    unsigned int flags;

     /* Only use flags that are relevant for the structure */
     flags = resolve_flags & GETADDR_CACHE_MASK;
@@ -269,7 +269,7 @@

 static int
 do_preresolve_host(struct context *c, const char *hostname, const char *servname, 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 = preresolve_flags;
+        unsigned int flags = preresolve_flags;

         struct connection_entry *ce = l->array[i];

@@ -1186,7 +1186,7 @@
     /* resolve local address if undefined */
     if (!sock->info.lsa->bind_local)
     {
-        int flags = GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE;
+        unsigned int flags = 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=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92
Gerrit-Change-Number: 1131
Gerrit-PatchSet: 7
Gerrit-Owner: flichtenheld <frank@...2641...>
Gerrit-Reviewer: cron2 <gert@...1296...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-MessageType: newpatchset

[-- Attachment #2: Type: text/html, Size: 8786 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int
       [not found] <gerrit.1754490554000.I5ef21e425786a49c90d4b7305c3fb174ab6ddf92@...2715...>
                   ` (4 preceding siblings ...)
  2025-09-19 16:42 ` [Openvpn-devel] [S] Change in openvpn[master]: " cron2 (Code Review)
@ 2025-09-19 16:42 ` cron2 (Code Review)
  5 siblings, 0 replies; 7+ messages in thread
From: cron2 (Code Review) @ 2025-09-19 16:42 UTC (permalink / raw)
  To: flichtenheld <frank@; +Cc: plaisthos <arne-openvpn@

[-- Attachment #1: Type: text/plain, Size: 4857 bytes --]

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1131?usp=email )

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 <frank@...2641...>
Acked-by: Gert Doering <gert@...1296...>
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/msg33098.html
Signed-off-by: Gert Doering <gert@...1296...>
---
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 *hostname, const char *servname,
-                     int ai_family, int resolve_flags, struct addrinfo **ai)
+                     int ai_family, unsigned int resolve_flags, struct addrinfo **ai)
 {
     struct cached_dns_entry *ph;
-    int flags;
+    unsigned int flags;

     /* Only use flags that are relevant for the structure */
     flags = resolve_flags & GETADDR_CACHE_MASK;
@@ -269,7 +269,7 @@

 static int
 do_preresolve_host(struct context *c, const char *hostname, const char *servname, 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 = preresolve_flags;
+        unsigned int flags = preresolve_flags;

         struct connection_entry *ce = l->array[i];

@@ -1186,7 +1186,7 @@
     /* resolve local address if undefined */
     if (!sock->info.lsa->bind_local)
     {
-        int flags = GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE;
+        unsigned int flags = 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=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92
Gerrit-Change-Number: 1131
Gerrit-PatchSet: 7
Gerrit-Owner: flichtenheld <frank@...2641...>
Gerrit-Reviewer: cron2 <gert@...1296...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-MessageType: merged

[-- Attachment #2: Type: text/html, Size: 8540 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-19 16:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <gerrit.1754490554000.I5ef21e425786a49c90d4b7305c3fb174ab6ddf92@...2715...>
2025-08-06 14:29 ` [Openvpn-devel] [S] Change in openvpn[master]: socket: Change resolve flags to unsigned int flichtenheld (Code Review)
2025-09-01 15:09 ` flichtenheld (Code Review)
2025-09-19 15:40 ` cron2 (Code Review)
2025-09-19 15:40 ` [Openvpn-devel] [PATCH v6] " Gert Doering
2025-09-19 16:42   ` [Openvpn-devel] [PATCH applied] " Gert Doering
2025-09-19 16:42 ` [Openvpn-devel] [S] Change in openvpn[master]: " cron2 (Code Review)
2025-09-19 16:42 ` cron2 (Code Review)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.