diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-09-19 22:06:02 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-09-19 22:06:02 +0200 |
commit | e80d0aebd691f1a707ab534b4d1340fa0b793e01 (patch) | |
tree | ffc3f4950b8045ac40736c17a082f4358ec11b70 /python/vyos/configdict.py | |
parent | e28a80a2b742ea3d9d4bcb8ae66c7a0d51aaaff6 (diff) | |
download | vyos-1x-e80d0aebd691f1a707ab534b4d1340fa0b793e01.tar.gz vyos-1x-e80d0aebd691f1a707ab534b4d1340fa0b793e01.zip |
vyos.ifconfig: T2738: do not remove OS assigned IP addresses from interface
When using VRRP on any given interface and performing an action against that
interface - be it even only changing the alias - will trigger a removal of the
VRRP IP address.
The issue is caused by:
# determine IP addresses which are assigned to the interface and build a
# list of addresses which are no longer in the dict so they can be removed
cur_addr = self.get_addr()
for addr in list_diff(cur_addr, new_addr):
When the script calls into the library - we will drop all IP addresses set on
the adapter but not available in the config dict.
We should only remove the IP addresses marked by the CLI to be deleted!
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r-- | python/vyos/configdict.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 8d7142049..5c6836e97 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -375,6 +375,9 @@ def get_interface_dict(config, base, ifname=''): # XXX: T2665: blend in proper DHCPv6-PD default values dict = T2665_set_dhcpv6pd_defaults(dict) + address = leaf_node_changed(config, ['address']) + if address: dict.update({'address_old' : address}) + # Check if we are a member of a bridge device bridge = is_member(config, ifname, 'bridge') if bridge: dict.update({'is_bridge_member' : bridge}) |