summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-22 22:03:53 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-22 22:03:53 +0200
commit677730107abc42d863f28c5decd4dadb761ee515 (patch)
tree681268b3efdb0bdcaa5ff52434e82627ea8c3143 /src
parent4505c1769d93334e426fbb2fb46948ffe19b289b (diff)
downloadvyos-1x-677730107abc42d863f28c5decd4dadb761ee515.tar.gz
vyos-1x-677730107abc42d863f28c5decd4dadb761ee515.zip
dhcpv6: T4357: only two IPv6 Cisco tftp servers should be defined
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/dhcpv6_server.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/dhcpv6_server.py b/src/conf_mode/dhcpv6_server.py
index b74106119..25f37d4fc 100755
--- a/src/conf_mode/dhcpv6_server.py
+++ b/src/conf_mode/dhcpv6_server.py
@@ -129,6 +129,10 @@ def verify(dhcpv6):
if ip_address(mapping_config['ipv6_address']) not in ip_network(subnet):
raise ConfigError(f'static-mapping address for mapping "{mapping}" is not in subnet "{subnet}"!')
+ if 'vendor_option' in subnet_config:
+ if len(dict_search('vendor_option.cisco.tftp_server', subnet_config)) > 2:
+ raise ConfigError(f'No more then two Cisco tftp-servers should be defined for subnet "{subnet}"!')
+
# Subnets must be unique
if subnet in subnets:
raise ConfigError(f'DHCPv6 subnets must be unique! Subnet {subnet} defined multiple times!')