[Openvpn-devel,v1] tun: Make error_flags unsigned consistently

Message ID 20261111183203.18722-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] tun: Make error_flags unsigned consistently |

Commit Message

Gert Doering Nov. 11, 2026, 6:31 p.m. UTC
  From: Frank Lichtenheld <frank@lichtenheld.com>

Previously both int and unsigned int was used.

Change-Id: Ie7228ee95c2b43f9be2bf4c6a9a959af2f729088
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Razvan Cojocaru <razvanc@mailbox.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2176
---

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/+/2176
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Razvan Cojocaru <razvanc@mailbox.org>
  

Patch

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 0bb5390..a92967e 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -1835,7 +1835,7 @@ 
 
 
 static bool
-do_open_tun(struct context *c, int *error_flags)
+do_open_tun(struct context *c, unsigned int *error_flags)
 {
     struct gc_arena gc = gc_new();
     bool ret = false;
@@ -2337,7 +2337,7 @@ 
 bool
 do_up(struct context *c, bool pulled_options, uint64_t option_types_found)
 {
-    int error_flags = 0;
+    unsigned int error_flags = 0;
     if (!c->c2.do_up_ran)
     {
         reset_coarse_timers(c);
@@ -2496,7 +2496,7 @@ 
     do_close_tun(c, true);
 
     management_sleep(1);
-    int error_flags = 0;
+    unsigned int error_flags = 0;
     c->c2.did_open_tun = do_open_tun(c, &error_flags);
     update_time();
 
@@ -4663,7 +4663,7 @@ 
      * open tun/tap device, ifconfig, run up script, etc. */
     if (!(options->up_delay || PULL_DEFINED(options)) && (c->mode == CM_P2P || c->mode == CM_TOP))
     {
-        int error_flags = 0;
+        unsigned int error_flags = 0;
         c->c2.did_open_tun = do_open_tun(c, &error_flags);
     }