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
(cherry picked from commit a21b8882cc)
This commit is contained in:
Beniamino Galvani 2017-05-12 12:00:20 +02:00
parent cbf5a776f7
commit bf5407992f

View file

@ -5487,8 +5487,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,
@ -6223,8 +6230,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) {