summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-03-14 17:10:03 +0100
committerGitHub <noreply@github.com>2024-03-14 17:10:03 +0100
commitc2e66922c93b60d12f1f30bded3cd6d4bae7e117 (patch)
treed61fae3a2d873fa11fd940e2f5eb8a884aaf9957
parent1ba302d55b86d63880fe2f55286fe82003f8a31f (diff)
parentd56b4c05726d4f4fb4fb5128a9223df1963fbdb7 (diff)
downloadvyos-1x-c2e66922c93b60d12f1f30bded3cd6d4bae7e117.tar.gz
vyos-1x-c2e66922c93b60d12f1f30bded3cd6d4bae7e117.zip
Merge pull request #3111 from nicolas-fort/T6110
T6110: dhcp: add error check when fail-over is enabled on a subnet, but range is not defined.
-rwxr-xr-xsrc/conf_mode/dhcp_server.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py
index ff0f5ecc5..b5d4a3ade 100755
--- a/src/conf_mode/dhcp_server.py
+++ b/src/conf_mode/dhcp_server.py
@@ -174,8 +174,11 @@ def verify(dhcp):
# DHCP failover needs at least one subnet that uses it
if 'enable_failover' in subnet_config:
if 'failover' not in dhcp:
- raise ConfigError(f'Can not enable failover for "{subnet}" in "{network}".\n' \
+ raise ConfigError(f'Cannot enable failover for "{subnet}" in "{network}".\n' \
'Failover is not configured globally!')
+ if 'range' not in subnet_config:
+ raise ConfigError(f'Cannot enable failover for "{subnet}" in "{network}".\n' \
+ f'Range is not configured for "{subnet}"')
failover_ok = True
# Check if DHCP address range is inside configured subnet declaration