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:55:43 +0200 |
commit | 3f6ae12908f54222f2f79a87bed51f71e2fbac87 (patch) | |
tree | 06a6eb26615118571b4e6295d08a9149990faf78 /python/vyos | |
parent | 081e23996feb60ad903caf8b0a4587f5dacc69bf (diff) | |
download | vyos-1x-3f6ae12908f54222f2f79a87bed51f71e2fbac87.tar.gz vyos-1x-3f6ae12908f54222f2f79a87bed51f71e2fbac87.zip |
ifconfig: T2104: cleanup IPv6 EUI-64 handling in update()
Diffstat (limited to 'python/vyos')
-rwxr-xr-x | 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 0256ca5df..8857f30e9 100755 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1482,16 +1482,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') |