diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/devices/nm-device.c | 4 | ||||
-rw-r--r-- | src/core/nm-l3-config-data.c | 36 | ||||
-rw-r--r-- | src/core/nm-l3-config-data.h | 1 | ||||
-rw-r--r-- | src/core/nm-l3-ipv4ll.c | 2 | ||||
-rw-r--r-- | src/core/nm-l3-ipv6ll.c | 9 | ||||
-rw-r--r-- | src/core/nm-l3cfg.c | 32 | ||||
-rw-r--r-- | src/core/nm-l3cfg.h | 9 | ||||
-rw-r--r-- | src/core/tests/test-l3cfg.c | 12 |
8 files changed, 20 insertions, 85 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 99d00ec4f2..d1702f23a5 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -4013,7 +4013,9 @@ _dev_l3_cfg_commit_type_reset(NMDevice *self) commit_type = NM_L3_CFG_COMMIT_TYPE_NONE; goto do_set; case NM_DEVICE_SYS_IFACE_STATE_ASSUME: - commit_type = NM_L3_CFG_COMMIT_TYPE_ASSUME; + /* TODO: NM_DEVICE_SYS_IFACE_STATE_ASSUME, will be dropped from the code. + * Meanwhile, the commit type must be updated. */ + commit_type = NM_L3_CFG_COMMIT_TYPE_UPDATE; goto do_set; case NM_DEVICE_SYS_IFACE_STATE_MANAGED: commit_type = NM_L3_CFG_COMMIT_TYPE_UPDATE; diff --git a/src/core/nm-l3-config-data.c b/src/core/nm-l3-config-data.c index c732840e31..5ab2f6b8d0 100644 --- a/src/core/nm-l3-config-data.c +++ b/src/core/nm-l3-config-data.c @@ -1172,13 +1172,6 @@ _l3_config_data_add_obj(NMDedupMultiIndex *multi_idx, modified = TRUE; } - /* OR assume_config_once flag */ - if (obj_new->ip_address.a_assume_config_once - && !obj_old->ip_address.a_assume_config_once) { - obj_new = nmp_object_stackinit_obj(&obj_new_stackinit, obj_new); - obj_new_stackinit.ip_address.a_assume_config_once = TRUE; - modified = TRUE; - } break; case NMP_OBJECT_TYPE_IP4_ROUTE: case NMP_OBJECT_TYPE_IP6_ROUTE: @@ -1189,13 +1182,6 @@ _l3_config_data_add_obj(NMDedupMultiIndex *multi_idx, modified = TRUE; } - /* OR assume_config_once flag */ - if (obj_new->ip_route.r_assume_config_once - && !obj_old->ip_route.r_assume_config_once) { - obj_new = nmp_object_stackinit_obj(&obj_new_stackinit, obj_new); - obj_new_stackinit.ip_route.r_assume_config_once = TRUE; - modified = TRUE; - } break; default: nm_assert_not_reached(); @@ -3056,9 +3042,8 @@ nm_l3_config_data_merge(NML3ConfigData *self, const NMPlatformIPAddress *a_src = NMP_OBJECT_CAST_IP_ADDRESS(obj); NMPlatformIPXAddress a; NML3ConfigMergeHookResult hook_result = { - .ip4acd_not_ready = NM_OPTION_BOOL_DEFAULT, - .assume_config_once = NM_OPTION_BOOL_DEFAULT, - .force_commit = NM_OPTION_BOOL_DEFAULT, + .ip4acd_not_ready = NM_OPTION_BOOL_DEFAULT, + .force_commit = NM_OPTION_BOOL_DEFAULT, }; #define _ensure_a() \ @@ -3091,12 +3076,6 @@ nm_l3_config_data_merge(NML3ConfigData *self, a.a4.a_acd_not_ready = (!!hook_result.ip4acd_not_ready); } - if (hook_result.assume_config_once != NM_OPTION_BOOL_DEFAULT - && (!!hook_result.assume_config_once) != a_src->a_assume_config_once) { - _ensure_a(); - a.ax.a_assume_config_once = (!!hook_result.assume_config_once); - } - if (hook_result.force_commit != NM_OPTION_BOOL_DEFAULT && (!!hook_result.force_commit) != a_src->a_force_commit) { _ensure_a(); @@ -3121,9 +3100,8 @@ nm_l3_config_data_merge(NML3ConfigData *self, const NMPlatformIPRoute *r_src = NMP_OBJECT_CAST_IP_ROUTE(obj); NMPlatformIPXRoute r; NML3ConfigMergeHookResult hook_result = { - .ip4acd_not_ready = NM_OPTION_BOOL_DEFAULT, - .assume_config_once = NM_OPTION_BOOL_DEFAULT, - .force_commit = NM_OPTION_BOOL_DEFAULT, + .ip4acd_not_ready = NM_OPTION_BOOL_DEFAULT, + .force_commit = NM_OPTION_BOOL_DEFAULT, }; #define _ensure_r() \ @@ -3149,12 +3127,6 @@ nm_l3_config_data_merge(NML3ConfigData *self, r.rx.ifindex = self->ifindex; } - if (hook_result.assume_config_once != NM_OPTION_BOOL_DEFAULT - && (!!hook_result.assume_config_once) != r_src->r_assume_config_once) { - _ensure_r(); - r.rx.r_assume_config_once = (!!hook_result.assume_config_once); - } - if (hook_result.force_commit != NM_OPTION_BOOL_DEFAULT && (!!hook_result.force_commit) != r_src->r_force_commit) { _ensure_r(); diff --git a/src/core/nm-l3-config-data.h b/src/core/nm-l3-config-data.h index b7a1bb32f5..20a32c62aa 100644 --- a/src/core/nm-l3-config-data.h +++ b/src/core/nm-l3-config-data.h @@ -137,7 +137,6 @@ NML3ConfigData *nm_l3_config_data_new_from_platform(NMDedupMultiIndex *mu typedef struct { NMOptionBool ip4acd_not_ready; - NMOptionBool assume_config_once; NMOptionBool force_commit; } NML3ConfigMergeHookResult; diff --git a/src/core/nm-l3-ipv4ll.c b/src/core/nm-l3-ipv4ll.c index 24f33c6771..2aedab5608 100644 --- a/src/core/nm-l3-ipv4ll.c +++ b/src/core/nm-l3-ipv4ll.c @@ -600,7 +600,7 @@ _l3cd_config_add(NML3IPv4LL *self) nm_assert_not_reached(); self->l3cfg_commit_handle = nm_l3cfg_commit_type_register(self->l3cfg, - NM_L3_CFG_COMMIT_TYPE_ASSUME, + NM_L3_CFG_COMMIT_TYPE_UPDATE, self->l3cfg_commit_handle, "ipv4ll"); nm_l3cfg_commit_on_idle_schedule(self->l3cfg, NM_L3_CFG_COMMIT_TYPE_AUTO); diff --git a/src/core/nm-l3-ipv6ll.c b/src/core/nm-l3-ipv6ll.c index 60da4ee8d7..2b9a1a0ef4 100644 --- a/src/core/nm-l3-ipv6ll.c +++ b/src/core/nm-l3-ipv6ll.c @@ -398,10 +398,7 @@ _lladdr_handle_changed(NML3IPv6LL *self) * NML3IPv4LL, where we use NM_L3_CONFIG_MERGE_FLAGS_ONLY_FOR_ACD. The difference * is that for IPv6 we let kernel do DAD, so we need to actually configure the * address. For IPv4, we can run ACD without configuring anything in kernel, - * and let the user decide how to proceed. - * - * Also in this case, we use the most graceful commit-type (NM_L3_CFG_COMMIT_TYPE_ASSUME), - * but for that to work, we also need NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE flag. */ + * and let the user decide how to proceed. */ l3cd = nm_l3_ipv6ll_get_l3cd(self); @@ -421,7 +418,7 @@ _lladdr_handle_changed(NML3IPv6LL *self) NM_DNS_PRIORITY_DEFAULT_NORMAL, NM_L3_ACD_DEFEND_TYPE_ALWAYS, 0, - NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE, + NM_L3CFG_CONFIG_FLAGS_NONE, NM_L3_CONFIG_MERGE_FLAGS_NONE)) changed = TRUE; } else { @@ -430,7 +427,7 @@ _lladdr_handle_changed(NML3IPv6LL *self) } self->l3cfg_commit_handle = nm_l3cfg_commit_type_register(self->l3cfg, - l3cd ? NM_L3_CFG_COMMIT_TYPE_ASSUME + l3cd ? NM_L3_CFG_COMMIT_TYPE_UPDATE : NM_L3_CFG_COMMIT_TYPE_NONE, self->l3cfg_commit_handle, "ipv6ll"); diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index e6a7858c44..6b7e6f4bc2 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -363,7 +363,6 @@ static NM_UTILS_ENUM2STR_DEFINE(_l3_cfg_commit_type_to_string, NML3CfgCommitType, NM_UTILS_ENUM2STR(NM_L3_CFG_COMMIT_TYPE_AUTO, "auto"), NM_UTILS_ENUM2STR(NM_L3_CFG_COMMIT_TYPE_NONE, "none"), - NM_UTILS_ENUM2STR(NM_L3_CFG_COMMIT_TYPE_ASSUME, "assume"), NM_UTILS_ENUM2STR(NM_L3_CFG_COMMIT_TYPE_UPDATE, "update"), NM_UTILS_ENUM2STR(NM_L3_CFG_COMMIT_TYPE_REAPPLY, "reapply"), ); @@ -768,14 +767,6 @@ _nm_n_acd_data_probe_new(NML3Cfg *self, in_addr_t addr, guint32 timeout_msec, gp } \ G_STMT_END -static gboolean -_obj_state_data_get_assume_config_once(const ObjStateData *obj_state) -{ - nm_assert_obj_state(NULL, obj_state); - - return nmp_object_get_assume_config_once(obj_state->obj); -} - static ObjStateData * _obj_state_data_new(const NMPObject *obj, const NMPObject *plobj) { @@ -1054,10 +1045,6 @@ _obj_states_sync_filter(NML3Cfg *self, const NMPObject *obj, NML3CfgCommitType c nm_assert(c_list_is_empty(&obj_state->os_zombie_lst)); if (!obj_state->os_nm_configured) { - if (commit_type == NM_L3_CFG_COMMIT_TYPE_ASSUME - && !_obj_state_data_get_assume_config_once(obj_state)) - return FALSE; - obj_state->os_nm_configured = TRUE; _LOGD("obj-state: configure-first-time: %s", @@ -3086,7 +3073,6 @@ nm_l3cfg_commit_on_idle_schedule(NML3Cfg *self, NML3CfgCommitType commit_type) nm_assert(NM_IS_L3CFG(self)); nm_assert(NM_IN_SET(commit_type, NM_L3_CFG_COMMIT_TYPE_AUTO, - NM_L3_CFG_COMMIT_TYPE_ASSUME, NM_L3_CFG_COMMIT_TYPE_UPDATE, NM_L3_CFG_COMMIT_TYPE_REAPPLY)); @@ -3501,7 +3487,6 @@ out_clear: typedef struct { NML3Cfg *self; gconstpointer tag; - bool assume_config_once; bool to_commit; bool force_commit_once; } L3ConfigMergeHookAddObjData; @@ -3521,11 +3506,9 @@ _l3_hook_add_obj_cb(const NML3ConfigData *l3cd, nm_assert(obj); nm_assert(hook_result); nm_assert(hook_result->ip4acd_not_ready == NM_OPTION_BOOL_DEFAULT); - nm_assert(hook_result->assume_config_once == NM_OPTION_BOOL_DEFAULT); nm_assert(hook_result->force_commit == NM_OPTION_BOOL_DEFAULT); - hook_result->assume_config_once = hook_data->assume_config_once; - hook_result->force_commit = hook_data->force_commit_once; + hook_result->force_commit = hook_data->force_commit_once; switch (NMP_OBJECT_GET_TYPE(obj)) { case NMP_OBJECT_TYPE_IP4_ADDRESS: @@ -3681,9 +3664,7 @@ _l3cfg_update_combined_config(NML3Cfg *self, if (NM_FLAGS_HAS(l3cd_data->config_flags, NM_L3CFG_CONFIG_FLAGS_ONLY_FOR_ACD)) continue; - hook_data.tag = l3cd_data->tag_confdata; - hook_data.assume_config_once = - NM_FLAGS_HAS(l3cd_data->config_flags, NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE); + hook_data.tag = l3cd_data->tag_confdata; hook_data.force_commit_once = l3cd_data->force_commit_once; nm_l3_config_data_merge(l3cd, @@ -4210,8 +4191,7 @@ _l3_commit_one(NML3Cfg *self, nm_assert(NM_IN_SET(commit_type, NM_L3_CFG_COMMIT_TYPE_NONE, NM_L3_CFG_COMMIT_TYPE_REAPPLY, - NM_L3_CFG_COMMIT_TYPE_UPDATE, - NM_L3_CFG_COMMIT_TYPE_ASSUME)); + NM_L3_CFG_COMMIT_TYPE_UPDATE)); nm_assert_addr_family(addr_family); _LOGT("committing IPv%c configuration (%s)", @@ -4297,7 +4277,6 @@ _l3_commit(NML3Cfg *self, NML3CfgCommitType commit_type, gboolean is_idle) nm_assert(NM_IN_SET(commit_type, NM_L3_CFG_COMMIT_TYPE_NONE, NM_L3_CFG_COMMIT_TYPE_AUTO, - NM_L3_CFG_COMMIT_TYPE_ASSUME, NM_L3_CFG_COMMIT_TYPE_UPDATE, NM_L3_CFG_COMMIT_TYPE_REAPPLY)); nm_assert(self->priv.p->commit_reentrant_count == 0); @@ -4421,10 +4400,7 @@ nm_l3cfg_commit_type_register(NML3Cfg *self, char buf[64]; nm_assert(NM_IS_L3CFG(self)); - nm_assert(NM_IN_SET(commit_type, - NM_L3_CFG_COMMIT_TYPE_NONE, - NM_L3_CFG_COMMIT_TYPE_ASSUME, - NM_L3_CFG_COMMIT_TYPE_UPDATE)); + nm_assert(NM_IN_SET(commit_type, NM_L3_CFG_COMMIT_TYPE_NONE, NM_L3_CFG_COMMIT_TYPE_UPDATE)); /* It would be easy (and maybe convenient) to allow that @existing_handle * can currently be registered on another NML3Cfg instance. But then we couldn't diff --git a/src/core/nm-l3cfg.h b/src/core/nm-l3cfg.h index 0ea6864661..f6ec39ced8 100644 --- a/src/core/nm-l3cfg.h +++ b/src/core/nm-l3cfg.h @@ -363,15 +363,6 @@ typedef enum _nm_packed { /* Don't touch the interface. */ NM_L3_CFG_COMMIT_TYPE_NONE, - /* ASSUME means to keep any pre-existing extra routes/addresses, while - * also not adding routes/addresses that are not present yet. This is to - * gracefully take over after restart, where the existing IP configuration - * should not change. - * - * The flag NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE can make certain addresses/ - * routes commitable also during "assume". */ - NM_L3_CFG_COMMIT_TYPE_ASSUME, - /* UPDATE means to add new addresses/routes, while also removing addresses/routes * that are no longer present (but were previously configured by NetworkManager). * Routes/addresses that were removed externally won't be re-added, and routes/addresses diff --git a/src/core/tests/test-l3cfg.c b/src/core/tests/test-l3cfg.c index 5106203ca6..924d98f16d 100644 --- a/src/core/tests/test-l3cfg.c +++ b/src/core/tests/test-l3cfg.c @@ -382,13 +382,11 @@ test_l3cfg(gconstpointer test_data) nm_l3cfg_commit_type_register(l3cfg0, NM_L3_CFG_COMMIT_TYPE_UPDATE, NULL, "test1"); if (!nmtst_get_rand_one_case_in(4)) { - commit_type_2 = - nm_l3cfg_commit_type_register(l3cfg0, - nmtst_rand_select(NM_L3_CFG_COMMIT_TYPE_NONE, - NM_L3_CFG_COMMIT_TYPE_ASSUME, - NM_L3_CFG_COMMIT_TYPE_UPDATE), - NULL, - "test2"); + commit_type_2 = nm_l3cfg_commit_type_register( + l3cfg0, + nmtst_rand_select(NM_L3_CFG_COMMIT_TYPE_NONE, NM_L3_CFG_COMMIT_TYPE_UPDATE), + NULL, + "test2"); } else commit_type_2 = NULL; |