diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-29 16:01:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-29 16:01:47 +0200 |
commit | a0e115d558001694060c97260ce8b5c66fbb5d4f (patch) | |
tree | 0c357fffa25e00e1a8d56c9302db6826e5d87934 /python/vyos | |
parent | 4ab2e833c048ae896333d8bfce6a38a42c266c1e (diff) | |
parent | 0de23064b9d575ce0569839e3b4453a0c2e9dc1c (diff) | |
download | vyos-1x-a0e115d558001694060c97260ce8b5c66fbb5d4f.tar.gz vyos-1x-a0e115d558001694060c97260ce8b5c66fbb5d4f.zip |
Merge pull request #981 from sever-sever/T3777
interfaces: T3777: Does not delete empty eui64 address
Diffstat (limited to 'python/vyos')
-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): """ |