mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 06:50:10 +01:00
device/trivial: rename private field in NMDevicePrivate
Rename "default_route.v4_configure_first_time" to "v4_commit_first_time".
For one, the name "commit" matches better to the @commit variable in ip4_config_merge_and_apply()
and ip6_config_merge_and_apply(). Then, we don't need this information
only for default-routes, so move the variable out of the @default_route
struct.
(cherry picked from commit ad03cdbc73)
This commit is contained in:
parent
3308114211
commit
83dadca08e
1 changed files with 15 additions and 12 deletions
|
|
@ -271,14 +271,15 @@ typedef struct {
|
|||
struct {
|
||||
gboolean v4_has;
|
||||
gboolean v4_is_assumed;
|
||||
gboolean v4_configure_first_time;
|
||||
NMPlatformIP4Route v4;
|
||||
gboolean v6_has;
|
||||
gboolean v6_is_assumed;
|
||||
gboolean v6_configure_first_time;
|
||||
NMPlatformIP6Route v6;
|
||||
} default_route;
|
||||
|
||||
gboolean v4_commit_first_time;
|
||||
gboolean v6_commit_first_time;
|
||||
|
||||
/* DHCPv4 tracking */
|
||||
NMDhcpClient * dhcp4_client;
|
||||
gulong dhcp4_state_sigid;
|
||||
|
|
@ -3302,7 +3303,7 @@ ip4_config_merge_and_apply (NMDevice *self,
|
|||
priv->default_route.v4_is_assumed = TRUE;
|
||||
|
||||
routes_full_sync = commit
|
||||
&& priv->default_route.v4_configure_first_time
|
||||
&& priv->v4_commit_first_time
|
||||
&& !nm_device_uses_assumed_connection (self);
|
||||
|
||||
if (!commit) {
|
||||
|
|
@ -3314,7 +3315,7 @@ ip4_config_merge_and_apply (NMDevice *self,
|
|||
= nm_default_route_manager_ip4_connection_has_default_route (nm_default_route_manager_get (),
|
||||
connection, &connection_is_never_default);
|
||||
|
||||
if ( !priv->default_route.v4_configure_first_time
|
||||
if ( !priv->v4_commit_first_time
|
||||
&& !nm_device_uses_assumed_connection (self)
|
||||
&& connection_is_never_default) {
|
||||
/* If the connection is explicitly configured as never-default, we enforce the (absense of the)
|
||||
|
|
@ -3330,7 +3331,7 @@ ip4_config_merge_and_apply (NMDevice *self,
|
|||
|
||||
/* we are about to commit (for a non-assumed connection). Enforce whatever we have
|
||||
* configured. */
|
||||
priv->default_route.v4_configure_first_time = FALSE;
|
||||
priv->v4_commit_first_time = FALSE;
|
||||
priv->default_route.v4_is_assumed = FALSE;
|
||||
|
||||
if (!connection_has_default_route)
|
||||
|
|
@ -3920,7 +3921,7 @@ ip6_config_merge_and_apply (NMDevice *self,
|
|||
priv->default_route.v6_is_assumed = TRUE;
|
||||
|
||||
routes_full_sync = commit
|
||||
&& priv->default_route.v6_configure_first_time
|
||||
&& priv->v6_commit_first_time
|
||||
&& !nm_device_uses_assumed_connection (self);
|
||||
|
||||
if (!commit) {
|
||||
|
|
@ -3932,7 +3933,7 @@ ip6_config_merge_and_apply (NMDevice *self,
|
|||
= nm_default_route_manager_ip6_connection_has_default_route (nm_default_route_manager_get (),
|
||||
connection, &connection_is_never_default);
|
||||
|
||||
if ( !priv->default_route.v6_configure_first_time
|
||||
if ( !priv->v6_commit_first_time
|
||||
&& !nm_device_uses_assumed_connection (self)
|
||||
&& connection_is_never_default) {
|
||||
/* If the connection is explicitly configured as never-default, we enforce the (absence of the)
|
||||
|
|
@ -3948,7 +3949,7 @@ ip6_config_merge_and_apply (NMDevice *self,
|
|||
|
||||
/* we are about to commit (for a non-assumed connection). Enforce whatever we have
|
||||
* configured. */
|
||||
priv->default_route.v6_configure_first_time = FALSE;
|
||||
priv->v6_commit_first_time = FALSE;
|
||||
priv->default_route.v6_is_assumed = FALSE;
|
||||
|
||||
if (!connection_has_default_route)
|
||||
|
|
@ -7930,10 +7931,11 @@ _cleanup_generic_post (NMDevice *self, CleanupType cleanup_type)
|
|||
|
||||
priv->default_route.v4_has = FALSE;
|
||||
priv->default_route.v4_is_assumed = TRUE;
|
||||
priv->default_route.v4_configure_first_time = TRUE;
|
||||
priv->default_route.v6_has = FALSE;
|
||||
priv->default_route.v6_is_assumed = TRUE;
|
||||
priv->default_route.v6_configure_first_time = TRUE;
|
||||
|
||||
priv->v4_commit_first_time = TRUE;
|
||||
priv->v6_commit_first_time = TRUE;
|
||||
|
||||
nm_default_route_manager_ip4_update_default_route (nm_default_route_manager_get (), self);
|
||||
nm_default_route_manager_ip6_update_default_route (nm_default_route_manager_get (), self);
|
||||
|
|
@ -8875,9 +8877,10 @@ nm_device_init (NMDevice *self)
|
|||
priv->ip6_saved_properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
|
||||
|
||||
priv->default_route.v4_is_assumed = TRUE;
|
||||
priv->default_route.v4_configure_first_time = TRUE;
|
||||
priv->default_route.v6_is_assumed = TRUE;
|
||||
priv->default_route.v6_configure_first_time = TRUE;
|
||||
|
||||
priv->v4_commit_first_time = TRUE;
|
||||
priv->v6_commit_first_time = TRUE;
|
||||
}
|
||||
|
||||
static GObject*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue