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.
This commit is contained in:
Thomas Haller 2021-09-02 16:51:36 +02:00
parent 4c3eed28cd
commit 3b92ad8b6d
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
4 changed files with 22 additions and 18 deletions

View file

@ -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;
/*****************************************************************************/

View file

@ -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,

View file

@ -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;

View file

@ -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 {