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);
     }
 
