aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon M. Busch-George <leon@georgemail.eu>2023-10-15 21:35:14 -0600
committerPhilip Prindeville <philipp@redfish-solutions.com>2023-10-15 21:35:14 -0600
commitdd2daafc6e2110b3816b5d81b2fa8de043b74824 (patch)
treed9abbbe94318182b0177db24b73b504b97c5ee6c
parent3ad482078b906a07a10b86dbd915d0b0a0b494c0 (diff)
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>
-rwxr-xr-xnet/isc-dhcp/files/dhcpd.init5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init
index 0caffb8a8..111201009 100755
--- a/net/isc-dhcp/files/dhcpd.init
+++ b/net/isc-dhcp/files/dhcpd.init
@@ -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"