diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-04-22 12:39:22 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-04-23 16:09:37 +0200 |
commit | 4940bea4f7b8574d30876fd3d0456e75f6f29877 (patch) | |
tree | e422582794edcdc00d14f3ae8578138da43eb6e6 /src/conf_mode/interfaces-openvpn.py | |
parent | d6c08414d55eadd8232b693303f2b14bfe121c01 (diff) | |
download | vyos-1x-4940bea4f7b8574d30876fd3d0456e75f6f29877.tar.gz vyos-1x-4940bea4f7b8574d30876fd3d0456e75f6f29877.zip |
interfaces: T2362: allow setting multiple 'ipv6 address eui64'
Diffstat (limited to 'src/conf_mode/interfaces-openvpn.py')
-rwxr-xr-x | src/conf_mode/interfaces-openvpn.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/conf_mode/interfaces-openvpn.py b/src/conf_mode/interfaces-openvpn.py index 469793910..668dcabb4 100755 --- a/src/conf_mode/interfaces-openvpn.py +++ b/src/conf_mode/interfaces-openvpn.py @@ -25,6 +25,7 @@ from time import sleep from shutil import rmtree from vyos.config import Config +from vyos.configdict import list_diff from vyos.ifconfig import VTunIf from vyos.template import render from vyos.util import call, chown, chmod_600, chmod_755 @@ -315,15 +316,14 @@ def get_config(): if conf.exists('ipv6 address autoconf'): openvpn['ipv6_autoconf'] = 1 - # Get prefix for IPv6 addressing based on MAC address (EUI-64) + # Get prefixes for IPv6 addressing based on MAC address (EUI-64) if conf.exists('ipv6 address eui64'): - openvpn['ipv6_eui64_prefix'].append(conf.return_value('ipv6 address eui64')) + openvpn['ipv6_eui64_prefix'] = conf.return_values('ipv6 address eui64') - # Determine currently effective EUI64 address - to determine which + # Determine currently effective EUI64 addresses - to determine which # address is no longer valid and needs to be removed - eff_addr = conf.return_effective_value('ipv6 address eui64') - if eff_addr and eff_addr not in openvpn['ipv6_eui64_prefix']: - openvpn['ipv6_eui64_prefix_remove'].append(eff_addr) + eff_addr = conf.return_effective_values('ipv6 address eui64') + openvpn['ipv6_eui64_prefix_remove'] = list_diff(eff_addr, openvpn['ipv6_eui64_prefix']) # add the link-local by default to make IPv6 work openvpn['ipv6_eui64_prefix'].append('fe80::/64') |