summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-06 21:17:42 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-06 21:20:34 +0200
commit84a429b41175b95634ec9492e0cf3a564a47abdd (patch)
treef644bdd5fa3951a9fd8dcf526ef861bd0e74c8e5 /python/vyos
parent90b9eeacfb626a82c842815371c32435bdf395a7 (diff)
downloadvyos-1x-84a429b41175b95634ec9492e0cf3a564a47abdd.tar.gz
vyos-1x-84a429b41175b95634ec9492e0cf3a564a47abdd.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.
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/configverify.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 7f49aa9af..760255d0e 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_vrf(config):
"""