From 3b92ad8b6df3e36ddfa536facb2bcc9bf2cdf9d7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 2 Sep 2021 16:51:36 +0200 Subject: [PATCH] l3cfg: change NM_L3_CONFIG_MERGE_FLAGS_ONLY_FOR_ACD to be a NML3CfgConfigFlags value It's really not related to NML3ConfigMergeFlags, but fits better to NML3CfgConfigFlags. --- src/core/nm-l3-config-data.h | 18 ++++-------------- src/core/nm-l3-ipv4ll.c | 4 ++-- src/core/nm-l3cfg.c | 2 +- src/core/nm-l3cfg.h | 16 +++++++++++++++- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/core/nm-l3-config-data.h b/src/core/nm-l3-config-data.h index 0ea5bd0e69..7391c4c110 100644 --- a/src/core/nm-l3-config-data.h +++ b/src/core/nm-l3-config-data.h @@ -52,15 +52,6 @@ typedef enum { /** * NML3ConfigMergeFlags: * @NM_L3_CONFIG_MERGE_FLAGS_NONE: no flags set - * @NM_L3_CONFIG_MERGE_FLAGS_ONLY_FOR_ACD: if this merge flag is set, - * the the NML3ConfigData doesn't get merged and it's information won't be - * synced. The only purpose is to run ACD on its IPv4 addresses, but - * regardless whether ACD succeeds/fails, the IP addresses won't be configured. - * The point is to run ACD first (without configuring it), and only - * commit the settings if requested. That can either happen by - * nm_l3cfg_add_config() the same NML3Cfg again (with a different - * tag), or by calling nm_l3cfg_add_config() again with this flag - * cleared (and the same tag). * @NM_L3_CONFIG_MERGE_FLAGS_NO_ROUTES: don't merge routes * @NM_L3_CONFIG_MERGE_FLAGS_NO_DEFAULT_ROUTES: don't merge default routes. * Note that if the respective NML3ConfigData has NM_L3_CONFIG_DAT_FLAGS_IGNORE_MERGE_NO_DEFAULT_ROUTES @@ -71,11 +62,10 @@ typedef enum { */ typedef enum _nm_packed { NM_L3_CONFIG_MERGE_FLAGS_NONE = 0, - NM_L3_CONFIG_MERGE_FLAGS_ONLY_FOR_ACD = (1LL << 0), - NM_L3_CONFIG_MERGE_FLAGS_NO_ROUTES = (1LL << 1), - NM_L3_CONFIG_MERGE_FLAGS_NO_DEFAULT_ROUTES = (1LL << 2), - NM_L3_CONFIG_MERGE_FLAGS_NO_DNS = (1LL << 3), - NM_L3_CONFIG_MERGE_FLAGS_CLONE = (1LL << 4), + NM_L3_CONFIG_MERGE_FLAGS_NO_ROUTES = (1LL << 0), + NM_L3_CONFIG_MERGE_FLAGS_NO_DEFAULT_ROUTES = (1LL << 1), + NM_L3_CONFIG_MERGE_FLAGS_NO_DNS = (1LL << 2), + NM_L3_CONFIG_MERGE_FLAGS_CLONE = (1LL << 3), } NML3ConfigMergeFlags; /*****************************************************************************/ diff --git a/src/core/nm-l3-ipv4ll.c b/src/core/nm-l3-ipv4ll.c index a0889341c9..521ff5ef24 100644 --- a/src/core/nm-l3-ipv4ll.c +++ b/src/core/nm-l3-ipv4ll.c @@ -593,8 +593,8 @@ _l3cd_config_add(NML3IPv4LL *self) 0, NM_L3_ACD_DEFEND_TYPE_ONCE, self->reg_timeout_msec, - NM_L3CFG_CONFIG_FLAGS_NONE, - NM_L3_CONFIG_MERGE_FLAGS_ONLY_FOR_ACD)) + NM_L3CFG_CONFIG_FLAGS_ONLY_FOR_ACD, + NM_L3_CONFIG_MERGE_FLAGS_NONE)) nm_assert_not_reached(); self->l3cfg_commit_handle = nm_l3cfg_commit_type_register(self->l3cfg, diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index 4234aadeea..06d74cadc7 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -3043,7 +3043,7 @@ _l3cfg_update_combined_config(NML3Cfg * self, for (i = 0; i < l3_config_datas_len; i++) { const L3ConfigData *l3cd_data = l3_config_datas_arr[i]; - if (NM_FLAGS_HAS(l3cd_data->merge_flags, NM_L3_CONFIG_MERGE_FLAGS_ONLY_FOR_ACD)) + if (NM_FLAGS_HAS(l3cd_data->config_flags, NM_L3CFG_CONFIG_FLAGS_ONLY_FOR_ACD)) continue; hook_data.tag = l3cd_data->tag_confdata; diff --git a/src/core/nm-l3cfg.h b/src/core/nm-l3cfg.h index 6e02103b1c..48ce86321a 100644 --- a/src/core/nm-l3cfg.h +++ b/src/core/nm-l3cfg.h @@ -28,8 +28,22 @@ typedef enum _nm_packed { NM_L3_ACD_DEFEND_TYPE_ALWAYS, } NML3AcdDefendType; +/** + * NML3CfgConfigFlags: + * @NM_L3CFG_CONFIG_FLAGS_NONE: no flags, the default. + * @NM_L3_CONFIG_MERGE_FLAGS_ONLY_FOR_ACD: if this merge flag is set, + * the the NML3ConfigData doesn't get merged and it's information won't be + * synced. The only purpose is to run ACD on its IPv4 addresses, but + * regardless whether ACD succeeds/fails, the IP addresses won't be configured. + * The point is to run ACD first (without configuring it), and only + * commit the settings if requested. That can either happen by + * nm_l3cfg_add_config() the same NML3Cfg again (with a different + * tag), or by calling nm_l3cfg_add_config() again with this flag + * cleared (and the same tag). + */ typedef enum _nm_packed { - NM_L3CFG_CONFIG_FLAGS_NONE = 0, + NM_L3CFG_CONFIG_FLAGS_NONE = 0, + NM_L3CFG_CONFIG_FLAGS_ONLY_FOR_ACD = (1LL << 0), } NML3CfgConfigFlags; typedef enum _nm_packed {