From fc4cd3aee5b212e6c82e1ee1a33736675ccf9afa Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Mon, 19 Jun 2023 19:29:17 -0600 Subject: [PATCH] isc-dhcp: don't require subnet pools Signed-off-by: Philip Prindeville --- net/isc-dhcp/Makefile | 2 +- net/isc-dhcp/files/dhcpd.init | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile index 981063dae5..d35609e388 100644 --- a/net/isc-dhcp/Makefile +++ b/net/isc-dhcp/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=isc-dhcp UPSTREAM_NAME:=dhcp PKG_VERSION:=4.4.3-P1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init index 8aa30cd27d..fd036c6ea4 100755 --- a/net/isc-dhcp/files/dhcpd.init +++ b/net/isc-dhcp/files/dhcpd.init @@ -369,7 +369,9 @@ gen_dhcp_subnet() { local cfg="$1" echo "subnet $NETWORK netmask $NETMASK {" - echo " range $START $END;" + if [ -n "$START" ] && [ -n "$END" ]; then + echo " range $START $END;" + fi echo " option subnet-mask $netmask;" if [ "$BROADCAST" != "0.0.0.0" ] ; then echo " option broadcast-address $BROADCAST;" @@ -408,10 +410,13 @@ dhcpd_add() { [ -n "$net" ] || return 0 config_get start "$cfg" "start" - [ -n "$start" ] || return 0 - config_get limit "$cfg" "limit" - [ -n "$limit" ] || return 0 + + case "$start:$limit" in + ":*"|"*:") + echo "dhcpd: start/limit must be used together in $cfg" >&2 + return 0 + esac network_get_subnet subnet "$net" || return 0 network_get_device ifname "$net" || return 0 -- 2.30.2