diff options
author | Thomas Haller <thaller@redhat.com> | 2021-02-09 16:26:53 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-03-12 12:43:03 +0100 |
commit | c861e87b7f3743c5df80d0436fef46d9acf9f9a3 (patch) | |
tree | 1046fa3149c888554149fec1391225a72e1cc784 | |
parent | d3d5b807d64acb09db4f56244278322810222c64 (diff) | |
download | NetworkManager-c861e87b7f3743c5df80d0436fef46d9acf9f9a3.tar.gz |
cloud-setup: fix replacing IPv4 addresses during update
If previously the profile would track two addresses ("10.116.1.130/24",
"10.116.1.65/24"), and during an update the second address was removed
(leaving "10.116.1.130/24"), then the addresses of the profile were
wrongly not changed.
The effect is that removing a secondary IP address might not take
effect.
Fix that.
https://bugzilla.redhat.com/show_bug.cgi?id=1920838
Fixes: 69f048bf0ca3 ('cloud-setup: add tool for automatic IP configuration in cloud')
(cherry picked from commit bbd36be44adcde91a86181bb5d6e9218caf39d2a)
-rw-r--r-- | clients/cloud-setup/nm-cloud-setup-utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clients/cloud-setup/nm-cloud-setup-utils.c b/clients/cloud-setup/nm-cloud-setup-utils.c index 0820ed59ea..e7443a9738 100644 --- a/clients/cloud-setup/nm-cloud-setup-utils.c +++ b/clients/cloud-setup/nm-cloud-setup-utils.c @@ -631,7 +631,7 @@ nmcs_setting_ip_replace_ipv4_addresses(NMSettingIPConfig *s_ip, i_next++; } - if (any_changes) { + if (!any_changes) { while (i_next < num) { nm_setting_ip_config_remove_address(s_ip, --num); any_changes = TRUE; |