From 4236848372a4565141167877f2eb32b0eedae577 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 19 Jul 2019 00:03:07 +0200 Subject: [DHCPv6 server] T1440: add subnet uniqueness check to DHCPv6. --- src/conf_mode/dhcpv6_server.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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?) -- cgit v1.2.3