Merge pull request #21410 from pprindeville/isc-dhcp-dont-require-pools

isc-dhcp: don't require subnet pools
This commit is contained in:
Philip Prindeville 2023-06-27 15:48:38 -06:00 committed by GitHub
commit 3522e9b89a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -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

View File

@ -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