diff options
| author | Alex Kudentsov <43482574+alexk37@users.noreply.github.com> | 2026-03-18 11:25:32 +0700 |
|---|---|---|
| committer | Alex Kudentsov <43482574+alexk37@users.noreply.github.com> | 2026-03-18 11:25:32 +0700 |
| commit | 65844cbb8bc47ec1d2f69e02615fa2e0f29389c8 (patch) | |
| tree | a0e1738dc2582d6c6e71c56bd9fd7a68b5bf7f7d | |
| parent | 91c5b76719f178b39beed380443a6d588c3dc08b (diff) | |
| download | vyos-1x-65844cbb8bc47ec1d2f69e02615fa2e0f29389c8.tar.gz vyos-1x-65844cbb8bc47ec1d2f69e02615fa2e0f29389c8.zip | |
T8399: move connectivity/overlap checks inside subnet loop
| -rwxr-xr-x | src/conf_mode/service_dhcpv6-server.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/conf_mode/service_dhcpv6-server.py b/src/conf_mode/service_dhcpv6-server.py index d7b2f2a6d..b567c8ed9 100755 --- a/src/conf_mode/service_dhcpv6-server.py +++ b/src/conf_mode/service_dhcpv6-server.py @@ -241,22 +241,22 @@ def verify(dhcpv6): subnets.append(subnet) - # DHCPv6 requires at least one configured address range or one static mapping - # (FIXME: is not actually checked right now?) - - # There must be one subnet connected to a listen interface if network is not disabled. - if 'disable' not in network_config: - if is_subnet_connected(subnet): - listen_ok = True - - # DHCPv6 subnet must not overlap. ISC DHCP also complains about overlapping - # subnets: "Warning: subnet 2001:db8::/32 overlaps subnet 2001:db8:1::/32" - net = ip_network(subnet) - for n in subnets: - net2 = ip_network(n) - if (net != net2): - if net.overlaps(net2): - raise ConfigError('DHCPv6 conflicting subnet ranges: {0} overlaps {1}'.format(net, net2)) + # DHCPv6 requires at least one configured address range or one static mapping + # (FIXME: is not actually checked right now?) + + # There must be one subnet connected to a listen interface if network is not disabled. + if 'disable' not in network_config: + if is_subnet_connected(subnet): + listen_ok = True + + # DHCPv6 subnet must not overlap. ISC DHCP also complains about overlapping + # subnets: "Warning: subnet 2001:db8::/32 overlaps subnet 2001:db8:1::/32" + net = ip_network(subnet) + for n in subnets: + net2 = ip_network(n) + if (net != net2): + if net.overlaps(net2): + raise ConfigError('DHCPv6 conflicting subnet ranges: {0} overlaps {1}'.format(net, net2)) if not listen_ok: raise ConfigError('None of the DHCPv6 subnets are connected to a subnet6 on '\ |
