summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-05-07 10:46:58 +0200
committerThomas Haller <thaller@redhat.com>2015-05-11 21:44:26 +0200
commit843205521fd45ee5e73b26696cc5f6b82853709c (patch)
tree6fd6c887bac3a01b3ec13bff7c1e1287010e881e
parent26aeb12749c6b81bd0e3b7aee8fe2b639353b102 (diff)
downloadNetworkManager-843205521fd45ee5e73b26696cc5f6b82853709c.tar.gz
device: fix configuring static ip addresses
When a connection had static IP addresses, an early event from plaform would clear them from priv->con_ip4_config. Fix that, by don't initializing priv->con_ip4_config before we commit the first time. https://bugzilla.gnome.org/show_bug.cgi?id=749052 Fixes: 557667df12fc05b76326d6406553985effeeb2ac
-rw-r--r--src/devices/nm-device.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index f764f013d3..cb996cbcdd 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3075,7 +3075,8 @@ ip4_config_merge_and_apply (NMDevice *self,
composite = nm_ip4_config_new (nm_device_get_ip_ifindex (self));
- ensure_con_ipx_config (self);
+ if (commit)
+ ensure_con_ipx_config (self);
if (priv->dev_ip4_config)
nm_ip4_config_merge (composite, priv->dev_ip4_config);
@@ -3652,7 +3653,8 @@ ip6_config_merge_and_apply (NMDevice *self,
/* If no config was passed in, create a new one */
composite = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
- ensure_con_ipx_config (self);
+ if (commit)
+ ensure_con_ipx_config (self);
g_assert (composite);
/* Merge all the IP configs into the composite config */
@@ -6901,7 +6903,6 @@ update_ip_config (NMDevice *self, gboolean initial)
g_clear_object (&priv->dev_ip4_config);
capture_lease_config (self, priv->ext_ip4_config, &priv->dev_ip4_config, NULL, NULL);
}
- ensure_con_ipx_config (self);
/* This function was called upon external changes. Remove the configuration
* (addresses,routes) that is no longer present externally from the internal
@@ -6940,8 +6941,6 @@ update_ip_config (NMDevice *self, gboolean initial)
linklocal6_just_completed = priv->linklocal6_timeout_id &&
have_ip6_address (priv->ext_ip6_config, TRUE);
- ensure_con_ipx_config (self);
-
/* This function was called upon external changes. Remove the configuration
* (addresses,routes) that is no longer present externally from the internal
* config. This way, we don't re-add addresses that were manually removed