mirror of
https://github.com/openwrt/packages.git
synced 2026-02-04 12:06:29 +08:00
isc-dhcp: replacing automatic empty needs addzone
Since the RFC-1918 in-addr.arpa empty zones are automatically created, they will exist, but we can't use modzone on them because that's not how things work. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
@@ -11,7 +11,7 @@ PKG_NAME:=isc-dhcp
|
||||
UPSTREAM_NAME:=dhcp
|
||||
PKG_REALVERSION:=4.4.3-P1
|
||||
PKG_VERSION:=4.4.3_p1
|
||||
PKG_RELEASE:=14
|
||||
PKG_RELEASE:=15
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -167,14 +167,19 @@ create_empty_zone() {
|
||||
chown bind:bind "$zpath" || return 1
|
||||
chmod 0664 "$zpath" || return 1
|
||||
|
||||
# if the zone doesn't exist, we need to add it, otherwise we need to
|
||||
# create it.
|
||||
# if the zone doesn't exist, or a RFC-1918 in-addr.arpa zone, then
|
||||
# we need to add it, otherwise we need to create it.
|
||||
if ! rndc zonestatus $zone >/dev/null 2>&1; then
|
||||
command="addzone"
|
||||
else
|
||||
command="modzone"
|
||||
fi
|
||||
|
||||
case "$zone" in
|
||||
10.in-addr.arpa|1[6789].172.in-addr.arpa|2[0-9].172.in-addr.arpa|3[01].172.in-addr.arpa|168.192.in-addr.arpa)
|
||||
command="addzone" ;;
|
||||
esac
|
||||
|
||||
if ! error=$(rndc $command $zone "{
|
||||
type primary;
|
||||
file \"$zpath\";
|
||||
|
||||
Reference in New Issue
Block a user