diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-09-20 21:55:43 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-09-20 21:56:46 +0200 |
commit | a6c5874445eba0eae5cb89a95358f4c6c74b7f79 (patch) | |
tree | 15719565234c3f25161dedca5d93dbad89c4eca0 /python/vyos | |
parent | c330504ceda582daca8c4982e0cf8adfb556f15d (diff) | |
download | vyos-1x-a6c5874445eba0eae5cb89a95358f4c6c74b7f79.tar.gz vyos-1x-a6c5874445eba0eae5cb89a95358f4c6c74b7f79.zip |
ifconfig: T2104: cleanup IPv6 EUI-64 handling in update()
(cherry picked from commit 3f6ae12908f54222f2f79a87bed51f71e2fbac87)
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ifconfig/interface.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index de46d3d66..89a562cf6 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1369,16 +1369,11 @@ class Interface(Control): self.set_mtu(config.get('mtu')) # Delete old IPv6 EUI64 addresses before changing MAC - tmp = dict_search('ipv6.address.eui64_old', config) - if tmp: - for addr in tmp: - self.del_ipv6_eui64_address(addr) + for addr in (dict_search('ipv6.address.eui64_old', config) or []): + self.del_ipv6_eui64_address(addr) # Manage IPv6 link-local addresses - tmp = dict_search('ipv6.address.no_default_link_local', config) - # we must check explicitly for None type as if the key is set we will - # get an empty dict (<class 'dict'>) - if isinstance(tmp, dict): + if dict_search('ipv6.address.no_default_link_local', config) != None: self.del_ipv6_eui64_address('fe80::/64') else: self.add_ipv6_eui64_address('fe80::/64') |