isc-dhcp: refuse to add empty DHCP range

ipcalc.sh no longer outputs invalid ranges and fails with an error code in
such cases. React to the error.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
This commit is contained in:
Leon M. Busch-George 2023-10-15 21:35:14 -06:00 committed by Philip Prindeville
parent 3ad482078b
commit dd2daafc6e
1 changed files with 4 additions and 1 deletions

View File

@ -445,7 +445,10 @@ dhcpd_add() {
dhcp_ifs="$dhcp_ifs $ifname"
ipcalc $subnet $start $limit
if ! ipcalc "$subnet" "$start" "$limit"; then
echo "invalid range params: $subnet start: $start limit $limit" >&2
return 1
fi
config_get netmask "$cfg" "netmask" "$NETMASK"
config_get leasetime "$cfg" "leasetime"