]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Change type of option flag from unsigned int to uint64_t
authorArne Schwabe <arne@rfc2549.org>
Wed, 25 Mar 2026 12:43:38 +0000 (13:43 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 27 Mar 2026 17:46:29 +0000 (18:46 +0100)
We currently use all 32 bits of the unsigned int for option classes.
While we can probably can retire 2-3 of the existing options, at some
point we will hit the limit again.

Instead of fully rewriting this logic to use a different approach or
structure, changing the type from unsigned int to uint64_t seem to be
a lot less intrusive approach.

Change-Id: I8ca07e2bbb5de229204191d61e90f084a58969af
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1583
Message-Id: <20260325124338.123477-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36266.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
14 files changed:
src/openvpn/init.c
src/openvpn/init.h
src/openvpn/multi.c
src/openvpn/multi.h
src/openvpn/options.c
src/openvpn/options.h
src/openvpn/options_parse.c
src/openvpn/options_util.c
src/openvpn/options_util.h
src/openvpn/push.c
src/openvpn/push.h
src/openvpn/push_util.c
tests/unit_tests/openvpn/test_options_parse.c
tests/unit_tests/openvpn/test_push_update_msg.c

index 34ed4eb57cc2ce3b86ad75e8d1120cab10ba07f5..9b7bd4242024d2d3e27da78eab4e6a35d48c0765 100644 (file)
@@ -2339,7 +2339,7 @@ do_deferred_options_part2(struct context *c)
 }
 
 bool
-do_up(struct context *c, bool pulled_options, unsigned int option_types_found)
+do_up(struct context *c, bool pulled_options, uint64_t option_types_found)
 {
     int error_flags = 0;
     if (!c->c2.do_up_ran)
@@ -2474,7 +2474,7 @@ do_up(struct context *c, bool pulled_options, unsigned int option_types_found)
 }
 
 bool
-do_update(struct context *c, unsigned int option_types_found)
+do_update(struct context *c, uint64_t option_types_found)
 {
     /* Not necessary since to receive the update the openvpn
      * instance must be up and running but just in case
@@ -2588,7 +2588,7 @@ do_deferred_p2p_ncp(struct context *c)
 }
 
 bool
-do_deferred_options(struct context *c, const unsigned int found, const bool is_update)
+do_deferred_options(struct context *c, const uint64_t found, const bool is_update)
 {
     if (found & OPT_P_MESSAGES)
     {
@@ -4209,7 +4209,7 @@ open_plugins(struct context *c, const bool import_options, int init_point)
                 int i;
                 for (i = 0; i < config.n; ++i)
                 {
-                    unsigned int option_types_found = 0;
+                    uint64_t option_types_found = 0;
                     if (config.list[i] && config.list[i]->value)
                     {
                         options_string_import(
index 9c4cf7123636c624b8189b5af6eaf83258c5bd15..9d5050d2d6348b406a9dc5ccdd0646e8e96c49ac 100644 (file)
@@ -75,7 +75,7 @@ void do_test_crypto(struct context *o);
 
 void context_gc_free(struct context *c);
 
-bool do_up(struct context *c, bool pulled_options, unsigned int option_types_found);
+bool do_up(struct context *c, bool pulled_options, uint64_t option_types_found);
 
 /**
  * @brief A simplified version of the do_up() function. This function is called
@@ -87,7 +87,7 @@ bool do_up(struct context *c, bool pulled_options, unsigned int option_types_fou
  * @return true on success.
  * @return false on error.
  */
-bool do_update(struct context *c, unsigned int option_types_found);
+bool do_update(struct context *c, uint64_t option_types_found);
 
 unsigned int pull_permission_mask(const struct context *c);
 
@@ -99,7 +99,7 @@ void reset_coarse_timers(struct context *c);
  * Handle non-tun-related pulled options.
  * Set `is_update` param to true to skip NCP check.
  */
-bool do_deferred_options(struct context *c, const unsigned int found, const bool is_update);
+bool do_deferred_options(struct context *c, const uint64_t found, const bool is_update);
 
 void inherit_context_child(struct context *dest, const struct context *src,
                            struct link_socket *sock);
index 1625fd021fca4946eec04622146c35f6122dd4ab..22f8b548f749bc7467f69ad7afbf97478aa6658e 100644 (file)
@@ -1619,7 +1619,7 @@ multi_set_virtual_addr_env(struct multi_instance *mi)
  */
 static void
 multi_client_connect_post(struct multi_context *m, struct multi_instance *mi, const char *dc_file,
-                          unsigned int *option_types_found)
+                          uint64_t *option_types_found)
 {
     /* Did script generate a dynamic config file? */
     if (platform_test_file(dc_file))
@@ -1645,7 +1645,7 @@ multi_client_connect_post(struct multi_context *m, struct multi_instance *mi, co
  */
 static void
 multi_client_connect_post_plugin(struct multi_context *m, struct multi_instance *mi,
-                                 const struct plugin_return *pr, unsigned int *option_types_found)
+                                 const struct plugin_return *pr, uint64_t *option_types_found)
 {
     struct plugin_return config;
 
@@ -1684,7 +1684,7 @@ multi_client_connect_post_plugin(struct multi_context *m, struct multi_instance
  */
 enum client_connect_return
 multi_client_connect_mda(struct multi_context *m, struct multi_instance *mi, bool deferred,
-                         unsigned int *option_types_found)
+                         uint64_t *option_types_found)
 {
     /* We never return CC_RET_DEFERRED */
     ASSERT(!deferred);
@@ -2055,7 +2055,7 @@ ccs_gen_config_file(struct multi_instance *mi)
 
 static enum client_connect_return
 multi_client_connect_call_plugin_v1(struct multi_context *m, struct multi_instance *mi,
-                                    bool deferred, unsigned int *option_types_found)
+                                    bool deferred, uint64_t *option_types_found)
 {
     enum client_connect_return ret = CC_RET_SKIPPED;
 #ifdef ENABLE_PLUGIN
@@ -2145,7 +2145,7 @@ cleanup:
 
 static enum client_connect_return
 multi_client_connect_call_plugin_v2(struct multi_context *m, struct multi_instance *mi,
-                                    bool deferred, unsigned int *option_types_found)
+                                    bool deferred, uint64_t *option_types_found)
 {
     enum client_connect_return ret = CC_RET_SKIPPED;
 #ifdef ENABLE_PLUGIN
@@ -2194,7 +2194,7 @@ multi_client_connect_call_plugin_v2(struct multi_context *m, struct multi_instan
 
 static enum client_connect_return
 multi_client_connect_script_deferred(struct multi_context *m, struct multi_instance *mi,
-                                     unsigned int *option_types_found)
+                                     uint64_t *option_types_found)
 {
     ASSERT(mi);
     ASSERT(option_types_found);
@@ -2235,7 +2235,7 @@ multi_client_connect_script_deferred(struct multi_context *m, struct multi_insta
  */
 static enum client_connect_return
 multi_client_connect_call_script(struct multi_context *m, struct multi_instance *mi, bool deferred,
-                                 unsigned int *option_types_found)
+                                 uint64_t *option_types_found)
 {
     if (deferred)
     {
@@ -2339,7 +2339,7 @@ multi_client_generate_tls_keys(struct context *c)
 
 static void
 multi_client_connect_late_setup(struct multi_context *m, struct multi_instance *mi,
-                                const unsigned int option_types_found)
+                                const uint64_t option_types_found)
 {
     ASSERT(m);
     ASSERT(mi);
@@ -2497,7 +2497,7 @@ multi_client_connect_early_setup(struct multi_context *m, struct multi_instance
  */
 static enum client_connect_return
 multi_client_connect_compress_migrate(struct multi_context *m, struct multi_instance *mi,
-                                      bool deferred, unsigned int *option_types_found)
+                                      bool deferred, uint64_t *option_types_found)
 {
 #ifdef USE_COMP
     struct options *o = &mi->context.options;
@@ -2529,7 +2529,7 @@ multi_client_connect_compress_migrate(struct multi_context *m, struct multi_inst
  */
 static enum client_connect_return
 multi_client_connect_source_ccd(struct multi_context *m, struct multi_instance *mi, bool deferred,
-                                unsigned int *option_types_found)
+                                uint64_t *option_types_found)
 {
     /* Since we never return a CC_RET_DEFERRED, this indicates a serious
      * problem */
@@ -2580,7 +2580,7 @@ multi_client_connect_source_ccd(struct multi_context *m, struct multi_instance *
 
 typedef enum client_connect_return (*multi_client_connect_handler)(
     struct multi_context *m, struct multi_instance *mi, bool from_deferred,
-    unsigned int *option_types_found);
+    uint64_t *option_types_found);
 
 static const multi_client_connect_handler client_connect_handlers[] = {
     multi_client_connect_compress_migrate,
@@ -2678,7 +2678,7 @@ multi_connection_established(struct multi_context *m, struct multi_instance *mi)
     bool from_deferred = (mi->context.c2.tls_multi->multi_state != CAS_PENDING);
 
     int *cur_handler_index = &mi->client_connect_defer_state.cur_handler_index;
-    unsigned int *option_types_found = &mi->client_connect_defer_state.option_types_found;
+    uint64_t *option_types_found = &mi->client_connect_defer_state.option_types_found;
 
     /* We are called for the first time */
     if (!from_deferred)
index c686e47c4bfc161771ae2995f73e509511a8a76e..7e2a77d4b01228257ec38e33c890aff1b6b3c79e 100644 (file)
@@ -73,7 +73,7 @@ struct client_connect_defer_state
     int cur_handler_index;
     /* Remember which option classes where processed for delayed option
      * handling. */
-    unsigned int option_types_found;
+    uint64_t option_types_found;
 
     /**
      * The temporary file name that contains the return status of the
index 24f2407df6b58d88d32dd061c725610b58a5535c..b4b19f27c678e4b80e974d69135afe57b889c300 100644 (file)
@@ -4972,8 +4972,8 @@ atou(const char *str)
     }
 
 static bool
-verify_permission(const char *name, const char *file, int line, const unsigned int type,
-                  const unsigned int allowed, unsigned int *found, const msglvl_t msglevel,
+verify_permission(const char *name, const char *file, int line, const uint64_t type,
+                  const uint64_t allowed, uint64_t *found, const msglvl_t msglevel,
                   struct options *options, bool is_inline)
 {
     if (!(type & allowed))
@@ -5065,7 +5065,7 @@ msglevel_forward_compatible(struct options *options, const msglvl_t msglevel)
 void
 remove_option(struct context *c, struct options *options, char *p[], bool is_inline,
               const char *file, int line, const msglvl_t msglevel,
-              const unsigned int permission_mask, unsigned int *option_types_found,
+              const uint64_t permission_mask, uint64_t *option_types_found,
               struct env_set *es)
 {
     msglvl_t msglevel_fc = msglevel_forward_compatible(options, msglevel);
@@ -5385,7 +5385,7 @@ check_dns_option(struct options *options, char *p[], const msglvl_t msglevel, bo
 void
 update_option(struct context *c, struct options *options, char *p[], bool is_inline,
               const char *file, int line, const int level, const msglvl_t msglevel,
-              const unsigned int permission_mask, unsigned int *option_types_found,
+              const uint64_t permission_mask, uint64_t *option_types_found,
               struct env_set *es)
 {
     const bool pull_mode = BOOL_CAST(permission_mask & OPT_P_PULL_MODE);
@@ -5574,8 +5574,8 @@ key_is_external(const struct options *options)
 
 void
 add_option(struct options *options, char *p[], bool is_inline, const char *file, int line,
-           const int level, const msglvl_t msglevel, const unsigned int permission_mask,
-           unsigned int *option_types_found, struct env_set *es)
+           const int level, const msglvl_t msglevel, const uint64_t permission_mask,
+           uint64_t *option_types_found, struct env_set *es)
 {
     struct gc_arena gc = gc_new();
     const bool pull_mode = BOOL_CAST(permission_mask & OPT_P_PULL_MODE);
index 3d8b50596b843bf6f21a4b1528dab3f026fd37b6..ae3156ac0be0a9ce892d283497a29d9f677dde62 100644 (file)
@@ -553,8 +553,8 @@ struct options
     bool client;
     bool pull; /* client pull of config options from server */
     int push_continuation;
-    unsigned int push_option_types_found;
-    unsigned int push_update_options_found; /* tracks which option types have been reset in current PUSH_UPDATE sequence */
+    uint64_t push_option_types_found;
+    uint64_t push_update_options_found; /* tracks which option types have been reset in current PUSH_UPDATE sequence */
     const char *auth_user_pass_file;
     bool auth_user_pass_file_inline;
     struct options_pre_connect *pre_connect;
@@ -808,7 +808,7 @@ struct pull_filter_list
 
 void add_option(struct options *options, char *p[], bool is_inline, const char *file,
                 int line, const int level, const msglvl_t msglevel,
-                const unsigned int permission_mask, unsigned int *option_types_found,
+                const uint64_t permission_mask, uint64_t *option_types_found,
                 struct env_set *es);
 
 /**
@@ -833,7 +833,7 @@ void add_option(struct options *options, char *p[], bool is_inline, const char *
  */
 void remove_option(struct context *c, struct options *options, char *p[], bool is_inline,
                    const char *file, int line, const msglvl_t msglevel,
-                   const unsigned int permission_mask, unsigned int *option_types_found,
+                   const uint64_t permission_mask, uint64_t *option_types_found,
                    struct env_set *es);
 
 /**
@@ -858,21 +858,21 @@ void remove_option(struct context *c, struct options *options, char *p[], bool i
  */
 void update_option(struct context *c, struct options *options, char *p[], bool is_inline,
                    const char *file, int line, const int level, const msglvl_t msglevel,
-                   const unsigned int permission_mask, unsigned int *option_types_found,
+                   const uint64_t permission_mask, uint64_t *option_types_found,
                    struct env_set *es);
 
 void parse_argv(struct options *options, const int argc, char *argv[], const msglvl_t msglevel,
-                const unsigned int permission_mask, unsigned int *option_types_found,
+                const uint64_t permission_mask, uint64_t *option_types_found,
                 struct env_set *es);
 
 void read_config_file(struct options *options, const char *file, int level, const char *top_file,
                       const int top_line, const msglvl_t msglevel,
-                      const unsigned int permission_mask, unsigned int *option_types_found,
+                      const uint64_t permission_mask, uint64_t *option_types_found,
                       struct env_set *es);
 
 void read_config_string(const char *prefix, struct options *options, const char *config,
-                        const msglvl_t msglevel, const unsigned int permission_mask,
-                        unsigned int *option_types_found, struct env_set *es);
+                        const msglvl_t msglevel, const uint64_t permission_mask,
+                        uint64_t *option_types_found, struct env_set *es);
 
 void notnull(const char *arg, const char *description);
 
@@ -933,13 +933,13 @@ bool options_postprocess_pull(struct options *o, struct env_set *es);
 void pre_connect_restore(struct options *o, struct gc_arena *gc);
 
 bool apply_push_options(struct context *c, struct options *options, struct buffer *buf,
-                        unsigned int permission_mask, unsigned int *option_types_found,
+                        uint64_t permission_mask, uint64_t *option_types_found,
                         struct env_set *es, bool is_update);
 
 void options_detach(struct options *o);
 
 void options_server_import(struct options *o, const char *filename, msglvl_t msglevel,
-                           unsigned int permission_mask, unsigned int *option_types_found,
+                           uint64_t permission_mask, uint64_t *option_types_found,
                            struct env_set *es);
 
 void pre_pull_default(struct options *o);
@@ -972,7 +972,7 @@ bool auth_retry_set(const msglvl_t msglevel, const char *option);
 const char *auth_retry_print(void);
 
 void options_string_import(struct options *options, const char *config, const msglvl_t msglevel,
-                           const unsigned int permission_mask, unsigned int *option_types_found,
+                           const uint64_t permission_mask, uint64_t *option_types_found,
                            struct env_set *es);
 
 bool key_is_external(const struct options *options);
index cb51ad2475f006a7621721824e35d6e3f6ae9186..a8c4aeefe99353358b1462a9568d35b60be6b28a 100644 (file)
@@ -346,7 +346,7 @@ check_inline_file_via_buf(struct buffer *multiline, char *p[], struct gc_arena *
 void
 read_config_file(struct options *options, const char *file, int level, const char *top_file,
                  const int top_line, const msglvl_t msglevel,
-                 const unsigned int permission_mask, unsigned int *option_types_found,
+                 const uint64_t permission_mask, uint64_t *option_types_found,
                  struct env_set *es)
 {
     const int max_recursive_levels = 10;
@@ -419,8 +419,8 @@ read_config_file(struct options *options, const char *file, int level, const cha
 
 void
 read_config_string(const char *prefix, struct options *options, const char *config,
-                   const msglvl_t msglevel, const unsigned int permission_mask,
-                   unsigned int *option_types_found, struct env_set *es)
+                   const msglvl_t msglevel, const uint64_t permission_mask,
+                   uint64_t *option_types_found, struct env_set *es)
 {
     char line[OPTION_LINE_SIZE];
     struct buffer multiline;
@@ -448,7 +448,7 @@ read_config_string(const char *prefix, struct options *options, const char *conf
 
 void
 parse_argv(struct options *options, const int argc, char *argv[], const msglvl_t msglevel,
-           const unsigned int permission_mask, unsigned int *option_types_found, struct env_set *es)
+           const uint64_t permission_mask, uint64_t *option_types_found, struct env_set *es)
 {
     /* usage message */
     if (argc <= 1)
@@ -510,7 +510,7 @@ parse_argv(struct options *options, const int argc, char *argv[], const msglvl_t
 
 bool
 apply_push_options(struct context *c, struct options *options, struct buffer *buf,
-                   unsigned int permission_mask, unsigned int *option_types_found,
+                   uint64_t permission_mask, uint64_t *option_types_found,
                    struct env_set *es, bool is_update)
 {
     char line[OPTION_PARM_SIZE];
@@ -523,7 +523,7 @@ apply_push_options(struct context *c, struct options *options, struct buffer *bu
         char *p[MAX_PARMS + 1];
         CLEAR(p);
         ++line_num;
-        unsigned int push_update_option_flags = 0;
+        uint64_t push_update_option_flags = 0;
         int i = 0;
 
         /* skip leading spaces matching the behaviour of parse_line */
@@ -578,7 +578,7 @@ apply_push_options(struct context *c, struct options *options, struct buffer *bu
 
 void
 options_server_import(struct options *o, const char *filename, msglvl_t msglevel,
-                      unsigned int permission_mask, unsigned int *option_types_found,
+                      const uint64_t permission_mask, uint64_t *option_types_found,
                       struct env_set *es)
 {
     msg(D_PUSH, "OPTIONS IMPORT: reading client specific options from: %s", filename);
@@ -588,7 +588,7 @@ options_server_import(struct options *o, const char *filename, msglvl_t msglevel
 
 void
 options_string_import(struct options *options, const char *config, const msglvl_t msglevel,
-                      const unsigned int permission_mask, unsigned int *option_types_found,
+                      const uint64_t permission_mask, uint64_t *option_types_found,
                       struct env_set *es)
 {
     read_config_string("[CONFIG-STRING]", options, config, msglevel, permission_mask,
index 8d0a1431de268d504c1e31d115c4613054e937e2..47fe0bc253060714bd0306cf4836db8c0215f386 100644 (file)
@@ -203,7 +203,7 @@ static const char *updatable_options[] = { "block-ipv6", "block-outside-dns",
                                            "tun-mtu", "keepalive" };
 
 bool
-check_push_update_option_flags(char *line, int *i, unsigned int *flags)
+check_push_update_option_flags(char *line, int *i, uint64_t *flags)
 {
     *flags = 0;
     bool opt_is_updatable = false;
index 511d1897dfd9ceeda46651a5f08fffb98a473c21..1d4ea9b956e385712681acebeb8dace591892ac2 100644 (file)
@@ -106,6 +106,6 @@ bool apply_pull_filter(const struct options *o, char *line);
  *         - The `line` parameter is empty or `NULL`.
  *         - The `?` flag is absent and the option is not updatable.
  */
-bool check_push_update_option_flags(char *line, int *i, unsigned int *flags);
+bool check_push_update_option_flags(char *line, int *i, uint64_t *flags);
 
 #endif /* ifndef OPTIONS_UTIL_H_ */
index 93c555853c224ff951c36dc4d0386f98eefe63af..835c4335862a268ab9745c5e34d38396fb55ffa8 100644 (file)
@@ -505,7 +505,7 @@ void
 incoming_push_message(struct context *c, const struct buffer *buffer)
 {
     struct gc_arena gc = gc_new();
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     msg(D_PUSH, "PUSH: Received control message: '%s'",
         sanitize_control_message(BSTR(buffer), &gc));
@@ -1060,8 +1060,8 @@ push_update_digest(md_ctx_t *ctx, struct buffer *buf, const struct options *opt)
 }
 
 static int
-process_incoming_push_reply(struct context *c, unsigned int permission_mask,
-                            unsigned int *option_types_found, struct buffer *buf)
+process_incoming_push_reply(struct context *c, uint64_t permission_mask,
+                            uint64_t *option_types_found, struct buffer *buf)
 {
     int ret = PUSH_MSG_ERROR;
     const int ch = buf_read_u8(buf);
@@ -1110,8 +1110,8 @@ process_incoming_push_reply(struct context *c, unsigned int permission_mask,
 
 int
 process_incoming_push_msg(struct context *c, const struct buffer *buffer,
-                          bool honor_received_options, unsigned int permission_mask,
-                          unsigned int *option_types_found)
+                          bool honor_received_options, uint64_t permission_mask,
+                          uint64_t *option_types_found)
 {
     struct buffer buf = *buffer;
 
index d18d058352076d1e7ebf02a3cebd6e4ca23f9cae..dff945fe814b4310f9195e3c6491963da0412579 100644 (file)
@@ -76,12 +76,12 @@ int process_incoming_push_request(struct context *c);
  * - `PUSH_MSG_ERROR`: An error occurred during message processing, or the message is invalid.
  */
 
-int process_push_update(struct context *c, struct options *o, unsigned int permission_mask,
-                        unsigned int *option_types_found, struct buffer *buf, bool msg_sender);
+int process_push_update(struct context *c, struct options *o, uint64_t permission_mask,
+                        uint64_t *option_types_found, struct buffer *buf, bool msg_sender);
 
 int process_incoming_push_msg(struct context *c, const struct buffer *buffer,
-                              bool honor_received_options, unsigned int permission_mask,
-                              unsigned int *option_types_found);
+                              bool honor_received_options, uint64_t permission_mask,
+                              uint64_t *option_types_found);
 
 bool send_push_request(struct context *c);
 
index 51c7b5f75c54319a8c4df5ceb9e978da263a4028..e129403f0fd23b67a1a0d98938071dc95acba321 100644 (file)
@@ -11,8 +11,8 @@
 #endif
 
 int
-process_push_update(struct context *c, struct options *o, unsigned int permission_mask,
-                    unsigned int *option_types_found, struct buffer *buf, bool msg_sender)
+process_push_update(struct context *c, struct options *o, uint64_t permission_mask,
+                    uint64_t *option_types_found, struct buffer *buf, bool msg_sender)
 {
     int ret = PUSH_MSG_ERROR;
     const int ch = buf_read_u8(buf);
@@ -146,7 +146,7 @@ send_single_push_update(struct multi_context *m, struct multi_instance *mi, stru
         return false;
     }
 
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
     struct context *c = &mi->context;
     struct options o;
     CLEAR(o);
index 0b3d7fe2596b03baa44af9442a61a920b73e4a9f..e67eae83c405d0ce3ee1d32b5b83c7a027ca395b 100644 (file)
@@ -40,7 +40,7 @@
 void
 add_option(struct options *options, char *p[], bool is_inline, const char *file,
            int line, const int level, const msglvl_t msglevel,
-           const unsigned int permission_mask, unsigned int *option_types_found,
+           const uint64_t permission_mask, uint64_t *option_types_found,
            struct env_set *es)
 {
     function_called();
@@ -51,7 +51,7 @@ add_option(struct options *options, char *p[], bool is_inline, const char *file,
 void
 remove_option(struct context *c, struct options *options, char *p[], bool is_inline,
               const char *file, int line, const msglvl_t msglevel,
-              const unsigned int permission_mask, unsigned int *option_types_found,
+              const uint64_t permission_mask, uint64_t *option_types_found,
               struct env_set *es)
 {
 }
@@ -59,7 +59,7 @@ remove_option(struct context *c, struct options *options, char *p[], bool is_inl
 void
 update_option(struct context *c, struct options *options, char *p[], bool is_inline,
               const char *file, int line, const int level, const msglvl_t msglevel,
-              const unsigned int permission_mask, unsigned int *option_types_found,
+              const uint64_t permission_mask, uint64_t *option_types_found,
               struct env_set *es)
 {
 }
@@ -191,7 +191,7 @@ test_parse_line(void **state)
 static void
 read_single_config(struct options *options, const char *config)
 {
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
     struct env_set es;
     CLEAR(es);
     read_config_string("test_options_parse", options, config, M_INFO, OPT_P_DEFAULT,
index 9b7978e51e217d9c87ca2984e5493cda0469b8dd..219b47665b7615349a311a89c6792fe720bd8949 100644 (file)
@@ -70,7 +70,7 @@ reset_route_counters(void)
 
 bool
 apply_push_options(struct context *c, struct options *options, struct buffer *buf,
-                   unsigned int permission_mask, unsigned int *option_types_found,
+                   uint64_t permission_mask, uint64_t *option_types_found,
                    struct env_set *es, bool is_update)
 {
     char line[OPTION_PARM_SIZE];
@@ -83,7 +83,7 @@ apply_push_options(struct context *c, struct options *options, struct buffer *bu
 
     while (buf_parse(buf, ',', line, sizeof(line)))
     {
-        unsigned int push_update_option_flags = 0;
+        uint64_t push_update_option_flags = 0;
         int i = 0;
 
         if (is_update || options->pull_filter_list)
@@ -131,8 +131,8 @@ apply_push_options(struct context *c, struct options *options, struct buffer *bu
 
 int
 process_incoming_push_msg(struct context *c, const struct buffer *buffer,
-                          bool honor_received_options, unsigned int permission_mask,
-                          unsigned int *option_types_found)
+                          bool honor_received_options, uint64_t permission_mask,
+                          uint64_t *option_types_found)
 {
     struct buffer buf = *buffer;
 
@@ -206,7 +206,7 @@ test_incoming_push_message_basic(void **state)
     const char *update_msg =
         "PUSH_UPDATE,dhcp-option DNS 8.8.8.8, route 0.0.0.0 0.0.0.0 10.10.10.1";
     buf_write(&buf, update_msg, strlen(update_msg));
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     assert_int_equal(process_incoming_push_msg(c, &buf, c->options.pull, pull_permission_mask(c),
                                                &option_types_found),
@@ -222,7 +222,7 @@ test_incoming_push_message_error1(void **state)
     struct buffer buf = alloc_buf(256);
     const char *update_msg = "PUSH_UPDATEerr,dhcp-option DNS 8.8.8.8";
     buf_write(&buf, update_msg, strlen(update_msg));
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     assert_int_equal(process_incoming_push_msg(c, &buf, c->options.pull, pull_permission_mask(c),
                                                &option_types_found),
@@ -238,7 +238,7 @@ test_incoming_push_message_error2(void **state)
     struct buffer buf = alloc_buf(256);
     const char *update_msg = "PUSH_UPDATE ,dhcp-option DNS 8.8.8.8";
     buf_write(&buf, update_msg, strlen(update_msg));
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     assert_int_equal(process_incoming_push_msg(c, &buf, c->options.pull, pull_permission_mask(c),
                                                &option_types_found),
@@ -254,7 +254,7 @@ test_incoming_push_message_1(void **state)
     struct buffer buf = alloc_buf(256);
     const char *update_msg = "PUSH_UPDATE, -?dns, route something, ?dhcp-option DNS 8.8.8.8";
     buf_write(&buf, update_msg, strlen(update_msg));
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     assert_int_equal(process_incoming_push_msg(c, &buf, c->options.pull, pull_permission_mask(c),
                                                &option_types_found),
@@ -270,7 +270,7 @@ test_incoming_push_message_bad_format(void **state)
     struct buffer buf = alloc_buf(256);
     const char *update_msg = "PUSH_UPDATE, -dhcp-option, ?-dns";
     buf_write(&buf, update_msg, strlen(update_msg));
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     assert_int_equal(process_incoming_push_msg(c, &buf, c->options.pull, pull_permission_mask(c),
                                                &option_types_found),
@@ -286,7 +286,7 @@ test_incoming_push_message_not_updatable_option(void **state)
     struct buffer buf = alloc_buf(256);
     const char *update_msg = "PUSH_UPDATE, dev tun";
     buf_write(&buf, update_msg, strlen(update_msg));
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     assert_int_equal(process_incoming_push_msg(c, &buf, c->options.pull, pull_permission_mask(c),
                                                &option_types_found),
@@ -303,7 +303,7 @@ test_incoming_push_message_mix(void **state)
     const char *update_msg =
         "PUSH_UPDATE,-dhcp-option, route 10.10.10.0, dhcp-option DNS 1.1.1.1, route 10.11.12.0, dhcp-option DOMAIN corp.local, keepalive 10 60";
     buf_write(&buf, update_msg, strlen(update_msg));
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     assert_int_equal(process_incoming_push_msg(c, &buf, c->options.pull, pull_permission_mask(c),
                                                &option_types_found),
@@ -320,7 +320,7 @@ test_incoming_push_message_mix2(void **state)
     const char *update_msg =
         "PUSH_UPDATE,-dhcp-option,dhcp-option DNS 8.8.8.8,redirect-gateway local,route 192.168.1.0 255.255.255.0";
     buf_write(&buf, update_msg, strlen(update_msg));
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     assert_int_equal(process_incoming_push_msg(c, &buf, c->options.pull, pull_permission_mask(c),
                                                &option_types_found),
@@ -344,7 +344,7 @@ static void
 test_incoming_push_continuation_route_accumulation(void **state)
 {
     struct context *c = *state;
-    unsigned int option_types_found = 0;
+    uint64_t option_types_found = 0;
 
     reset_route_counters();