summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-07-19 00:03:07 +0200
committerDaniil Baturin <daniil@baturin.org>2019-07-19 00:03:07 +0200
commit4236848372a4565141167877f2eb32b0eedae577 (patch)
tree13fee72813ca4491be6de4420998df1c911cda0f
parentfdcce3a65e556eed1ced4156d71bbc32b3c87d5a (diff)
downloadvyos-1x-4236848372a4565141167877f2eb32b0eedae577.tar.gz
vyos-1x-4236848372a4565141167877f2eb32b0eedae577.zip
[DHCPv6 server] T1440: add subnet uniqueness check to DHCPv6.
-rwxr-xr-xsrc/conf_mode/dhcpv6_server.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/dhcpv6_server.py b/src/conf_mode/dhcpv6_server.py
index d2769466e..039321430 100755
--- a/src/conf_mode/dhcpv6_server.py
+++ b/src/conf_mode/dhcpv6_server.py
@@ -397,6 +397,12 @@ def verify(dhcpv6):
'in shared network {2} is outside subnet {3}!' \
.format(mapping['ipv6_address'], mapping['name'], network['name'], subnet['network']))
+ # Subnets must be unique
+ if subnet['network'] in subnets:
+ raise ConfigError('DHCPv6 subnets must be unique! Subnet {0} defined multiple times!'.format(subnet['network']))
+ else:
+ subnets.append(subnet['network'])
+
# DHCPv6 requires at least one configured address range or one static mapping
# (FIXME: is not actually checked right now?)