isc-dhcp: add support for multi-homing in 'domain' configs

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
Philip Prindeville 2021-01-28 18:05:12 -07:00
parent 825b2c7e4f
commit a138ceec86
2 changed files with 8 additions and 5 deletions

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=isc-dhcp PKG_NAME:=isc-dhcp
UPSTREAM_NAME:=dhcp UPSTREAM_NAME:=dhcp
PKG_VERSION:=4.4.1 PKG_VERSION:=4.4.1
PKG_RELEASE:=13 PKG_RELEASE:=14
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE PKG_LICENSE_FILES:=LICENSE

View file

@ -179,17 +179,20 @@ static_cnames() {
static_domain_add() { static_domain_add() {
local cfg="$1" local cfg="$1"
local name ip revip local name ip ips revip
config_get name "$cfg" "name" config_get name "$cfg" "name"
[ -n "$name" ] || return 0 [ -n "$name" ] || return 0
config_get ip "$cfg" "ip" config_get ip "$cfg" "ip"
[ -n "$ip" ] || return 0 [ -n "$ip" ] || return 0
revip="$(rev_str "$ip" ".")" ips="$ip"
for ip in $ips; do
revip="$(rev_str "$ip" ".")"
update "$name.$domain." IN A "$ip" update "$name.$domain." IN A "$ip"
update "$revip.in-addr.arpa." IN PTR "$name.$domain." update "$revip.in-addr.arpa." IN PTR "$name.$domain."
done
} }
static_domains() { static_domains() {