diff options
author | Viacheslav <v.gletenko@vyos.io> | 2021-08-29 11:12:01 +0000 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-08-29 20:35:13 +0200 |
commit | e5796497d5585aac85590e3aa9a80ae67160505a (patch) | |
tree | 17581d7aaac7801f7cded6b53b55a9b7d6cfc87f /python/vyos/ifconfig/interface.py | |
parent | afef799f215d47bed81474b01bcead1eb2aa1cd6 (diff) | |
download | vyos-1x-e5796497d5585aac85590e3aa9a80ae67160505a.tar.gz vyos-1x-e5796497d5585aac85590e3aa9a80ae67160505a.zip |
interfaces: T3777: Does not delete empty eui64 address
Check eui64_old value before deleting
It can be empty or not ipv6 address.
(cherry picked from commit 0de23064b9d575ce0569839e3b4453a0c2e9dc1c)
Diffstat (limited to 'python/vyos/ifconfig/interface.py')
-rwxr-xr-x | python/vyos/ifconfig/interface.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 45a220e22..2a7b1eadc 100755 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -38,6 +38,7 @@ from vyos.util import dict_search from vyos.util import read_file from vyos.util import get_interface_config from vyos.template import is_ipv4 +from vyos.template import is_ipv6 from vyos.validate import is_intf_addr_assigned from vyos.validate import is_ipv6_link_local from vyos.validate import assert_boolean @@ -667,9 +668,10 @@ class Interface(Control): Delete the address based on the interface's MAC-based EUI64 combined with the prefix address. """ - eui64 = mac2eui64(self.get_mac(), prefix) - prefixlen = prefix.split('/')[1] - self.del_addr(f'{eui64}/{prefixlen}') + if is_ipv6(prefix): + eui64 = mac2eui64(self.get_mac(), prefix) + prefixlen = prefix.split('/')[1] + self.del_addr(f'{eui64}/{prefixlen}') def set_ipv6_forwarding(self, forwarding): """ |