summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-05-12 12:00:20 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-05-16 11:37:41 +0200
commita21b8882cc9defc43248afc94bf59ca0f84f0d27 (patch)
tree62a3e55f75b8631e80385a7f1f1a6df4e76465e8
parent36e97f5d7beba7ab5446c2b7c6c22523b1bca476 (diff)
downloadNetworkManager-a21b8882cc9defc43248afc94bf59ca0f84f0d27.tar.gz
device: update external configuration before commit
If the platform signaled that the external configuration changed (and thus update_ipX_config() is scheduled) and we are doing a commit of the new configuration, update priv->ext_ipX_config. Without this, the commit will remove addresses added externally but not yet captured in the external configuration. https://bugzilla.redhat.com/show_bug.cgi?id=1449873
-rw-r--r--src/devices/nm-device.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 4f70d75d66..9966bf9ac8 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -5440,8 +5440,15 @@ ip4_config_merge_and_apply (NMDevice *self,
composite = nm_ip4_config_new (nm_device_get_ip_ifindex (self));
init_ip4_config_dns_priority (self, composite);
- if (commit)
+ if (commit) {
ensure_con_ip4_config (self);
+ if (priv->queued_ip4_config_id) {
+ g_clear_object (&priv->ext_ip4_config);
+ priv->ext_ip4_config = nm_ip4_config_capture (nm_device_get_platform (self),
+ nm_device_get_ifindex (self),
+ FALSE);
+ }
+ }
if (priv->dev_ip4_config) {
nm_ip4_config_merge (composite, priv->dev_ip4_config,
@@ -6173,8 +6180,18 @@ ip6_config_merge_and_apply (NMDevice *self,
NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN);
init_ip6_config_dns_priority (self, composite);
- if (commit)
+ if (commit) {
ensure_con_ip6_config (self);
+ if (priv->queued_ip6_config_id) {
+ g_clear_object (&priv->ext_ip6_config);
+ g_clear_object (&priv->ext_ip6_config_captured);
+ priv->ext_ip6_config_captured = nm_ip6_config_capture (nm_device_get_platform (self),
+ nm_device_get_ifindex (self),
+ FALSE,
+ NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN);
+ priv->ext_ip6_config = nm_ip6_config_new_cloned (priv->ext_ip6_config_captured);
+ }
+ }
/* Merge all the IP configs into the composite config */
if (priv->ac_ip6_config) {