diff options
author | Viacheslav <v.gletenko@vyos.io> | 2021-08-29 11:12:01 +0000 |
---|---|---|
committer | Viacheslav <v.gletenko@vyos.io> | 2021-08-29 13:14:10 +0000 |
commit | 0de23064b9d575ce0569839e3b4453a0c2e9dc1c (patch) | |
tree | 0c357fffa25e00e1a8d56c9302db6826e5d87934 /python | |
parent | 4ab2e833c048ae896333d8bfce6a38a42c266c1e (diff) | |
download | vyos-1x-0de23064b9d575ce0569839e3b4453a0c2e9dc1c.tar.gz vyos-1x-0de23064b9d575ce0569839e3b4453a0c2e9dc1c.zip |
interfaces: T3777: Does not delete empty eui64 address
Check eui64_old value before deleting
It can be empty or not ipv6 address.
Diffstat (limited to 'python')
-rw-r--r-- | 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 e815c0129..d47403488 100644 --- 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 @@ -588,9 +589,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): """ |