From: Leon M. Busch-George Date: Mon, 16 Oct 2023 03:35:14 +0000 (-0600) Subject: isc-dhcp: refuse to add empty DHCP range X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=dd2daafc6e2110b3816b5d81b2fa8de043b74824;p=openwrt-packages.git 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 --- 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"