From dd2daafc6e2110b3816b5d81b2fa8de043b74824 Mon Sep 17 00:00:00 2001 From: "Leon M. Busch-George" Date: Sun, 15 Oct 2023 21:35:14 -0600 Subject: 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 --- net/isc-dhcp/files/dhcpd.init | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'net') 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" -- cgit v1.2.3