mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-30 13:20:47 +02:00
platform: move ip4acd_not_ready flag to NMPlatformIP4Address
This flag is only relevant for IPv4. That is, because the way we do ACD/DAD is fundamentally different between IPv4 and IPv6. For IPv4, we use libn-acd while IPv6 we configure the address in kernel and wait for the tentative flag to go away.
This commit is contained in:
parent
e07b41c430
commit
a909a4b305
4 changed files with 12 additions and 12 deletions
|
|
@ -2761,9 +2761,9 @@ nm_l3_config_data_merge(NML3ConfigData * self,
|
|||
|
||||
if (hook_result.ip4acd_not_ready != NM_OPTION_BOOL_DEFAULT && IS_IPv4
|
||||
&& (!!hook_result.ip4acd_not_ready)
|
||||
!= ((const NMPlatformIP4Address *) a_src)->ip4acd_not_ready) {
|
||||
!= ((const NMPlatformIP4Address *) a_src)->a_acd_not_ready) {
|
||||
_ensure_a();
|
||||
a.a4.ip4acd_not_ready = (!!hook_result.ip4acd_not_ready);
|
||||
a.a4.a_acd_not_ready = (!!hook_result.ip4acd_not_ready);
|
||||
}
|
||||
|
||||
nm_l3_config_data_add_address_full(self,
|
||||
|
|
|
|||
|
|
@ -701,7 +701,7 @@ _l3cfg_externally_removed_objs_filter(/* const NMDedupMultiObj * */ gconstpointe
|
|||
GHashTable * externally_removed_objs_hash = user_data;
|
||||
|
||||
if (NMP_OBJECT_GET_TYPE(obj) == NMP_OBJECT_TYPE_IP4_ADDRESS
|
||||
&& NMP_OBJECT_CAST_IP4_ADDRESS(obj)->ip4acd_not_ready)
|
||||
&& NMP_OBJECT_CAST_IP4_ADDRESS(obj)->a_acd_not_ready)
|
||||
return FALSE;
|
||||
|
||||
return !nm_g_hash_table_contains(externally_removed_objs_hash, obj);
|
||||
|
|
|
|||
|
|
@ -6303,7 +6303,7 @@ nm_platform_ip4_address_to_string(const NMPlatformIP4Address *address, char *buf
|
|||
"%s" /* label */
|
||||
" src %s"
|
||||
"%s" /* external */
|
||||
"%s" /* ip4acd_not_ready */
|
||||
"%s" /* a_acd_not_ready */
|
||||
"%s" /* a_assume_config_once */
|
||||
"",
|
||||
s_address,
|
||||
|
|
@ -6323,7 +6323,7 @@ nm_platform_ip4_address_to_string(const NMPlatformIP4Address *address, char *buf
|
|||
str_label,
|
||||
nmp_utils_ip_config_source_to_string(address->addr_source, s_source, sizeof(s_source)),
|
||||
address->external ? " ext" : "",
|
||||
address->ip4acd_not_ready ? " ip4acd-not-ready" : "",
|
||||
address->a_acd_not_ready ? " ip4acd-not-ready" : "",
|
||||
address->a_assume_config_once ? " assume-config-once" : "");
|
||||
g_free(str_peer);
|
||||
return buf;
|
||||
|
|
@ -7876,7 +7876,7 @@ nm_platform_ip4_address_hash_update(const NMPlatformIP4Address *obj, NMHashState
|
|||
NM_HASH_COMBINE_BOOLS(guint8,
|
||||
obj->external,
|
||||
obj->use_ip4_broadcast_address,
|
||||
obj->ip4acd_not_ready,
|
||||
obj->a_acd_not_ready,
|
||||
obj->a_assume_config_once));
|
||||
nm_hash_update_strarr(h, obj->label);
|
||||
}
|
||||
|
|
@ -7899,7 +7899,7 @@ nm_platform_ip4_address_cmp(const NMPlatformIP4Address *a, const NMPlatformIP4Ad
|
|||
NM_CMP_FIELD(a, b, n_ifa_flags);
|
||||
NM_CMP_FIELD_STR(a, b, label);
|
||||
NM_CMP_FIELD_UNSAFE(a, b, external);
|
||||
NM_CMP_FIELD_UNSAFE(a, b, ip4acd_not_ready);
|
||||
NM_CMP_FIELD_UNSAFE(a, b, a_acd_not_ready);
|
||||
NM_CMP_FIELD_UNSAFE(a, b, a_assume_config_once);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,11 +325,6 @@ typedef enum {
|
|||
\
|
||||
bool use_ip4_broadcast_address : 1; \
|
||||
\
|
||||
/* Whether the address is ready to be configured. By default, an address is, but this
|
||||
* flag may indicate that the address is just for tracking purpose only, but the ACD
|
||||
* state is not yet ready for the address to be configured. */ \
|
||||
bool ip4acd_not_ready : 1; \
|
||||
\
|
||||
/* Whether the address is should be configured once during assume. This is a meta flag
|
||||
* that is not honored by NMPlatform (netlink code). Instead, it can be used by the upper
|
||||
* layers which use NMPlatformIPAddress to track addresses that should be configured. */ \
|
||||
|
|
@ -356,6 +351,11 @@ typedef struct {
|
|||
struct _NMPlatformIP4Address {
|
||||
__NMPlatformIPAddress_COMMON;
|
||||
|
||||
/* Whether the address is ready to be configured. By default, an address is, but this
|
||||
* flag may indicate that the address is just for tracking purpose only, but the ACD
|
||||
* state is not yet ready for the address to be configured. */
|
||||
bool a_acd_not_ready : 1;
|
||||
|
||||
/* The local address IFA_LOCAL. */
|
||||
in_addr_t address;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue