diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-09-06 21:17:42 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-09-06 21:24:42 +0200 |
commit | c6039b9a82fe8a1752dc82a9834faf3a85b5dd38 (patch) | |
tree | 3ae65c129f46fb2b899b1cc71367967ee64beb9b /python/vyos/configverify.py | |
parent | 591eee82296b69b9d8ed49ca28683d0f016c85b8 (diff) | |
download | vyos-1x-c6039b9a82fe8a1752dc82a9834faf3a85b5dd38.tar.gz vyos-1x-c6039b9a82fe8a1752dc82a9834faf3a85b5dd38.zip |
ifconfig: T3806: "ipv6 address no_default_link_local" required for MTU < 1280
This commit also extends the smoketest to verify that the exception for this
error is raised.
(cherry picked from commit 84a429b41175b95634ec9492e0cf3a564a47abdd)
Diffstat (limited to 'python/vyos/configverify.py')
-rw-r--r-- | python/vyos/configverify.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index cff673a6e..ce7e76eb4 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -67,22 +67,22 @@ def verify_mtu_ipv6(config): min_mtu = 1280 if int(config['mtu']) < min_mtu: interface = config['ifname'] - error_msg = f'IPv6 address will be configured on interface "{interface}" ' \ - f'thus the minimum MTU requirement is {min_mtu}!' + error_msg = f'IPv6 address will be configured on interface "{interface}",\n' \ + f'the required minimum MTU is {min_mtu}!' - for address in (dict_search('address', config) or []): - if address in ['dhcpv6'] or is_ipv6(address): - raise ConfigError(error_msg) + if 'address' in config: + for address in config['address']: + if address in ['dhcpv6'] or is_ipv6(address): + raise ConfigError(error_msg) - tmp = dict_search('ipv6.address', config) - if tmp and 'no_default_link_local' not in tmp: - raise ConfigError('link-local ' + error_msg) + tmp = dict_search('ipv6.address.no_default_link_local', config) + if tmp == None: raise ConfigError('link-local ' + error_msg) - if tmp and 'autoconf' in tmp: - raise ConfigError(error_msg) + tmp = dict_search('ipv6.address.autoconf', config) + if tmp != None: raise ConfigError(error_msg) - if tmp and 'eui64' in tmp: - raise ConfigError(error_msg) + tmp = dict_search('ipv6.address.eui64', config) + if tmp != None: raise ConfigError(error_msg) def verify_tunnel(config): """ |