NetworkManager/0003-device-trivial-rename-private-field-in-NMDevicePriva.patch

124 lines
4.8 KiB
Diff

From 83dadca08ef9606a8541b26d3a2b93a66d828055 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 22 Jul 2015 11:40:35 +0200
Subject: [PATCH 03/11] 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 ad03cdbc73dad81aa8934afa2060ccbd9e776f7f)
---
src/devices/nm-device.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index bf4ca8e..867f384 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -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*
--
2.4.3