From a138ceec863cfd934f4413f545d1527c300dcb80 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Thu, 28 Jan 2021 18:05:12 -0700 Subject: [PATCH] isc-dhcp: add support for multi-homing in 'domain' configs Signed-off-by: Philip Prindeville --- net/isc-dhcp/Makefile | 2 +- net/isc-dhcp/files/dhcpd.init | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile index e01b10eb9..ee5b51320 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.1 -PKG_RELEASE:=13 +PKG_RELEASE:=14 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 1436e7e2a..14b4a2748 100755 --- a/net/isc-dhcp/files/dhcpd.init +++ b/net/isc-dhcp/files/dhcpd.init @@ -179,17 +179,20 @@ static_cnames() { static_domain_add() { local cfg="$1" - local name ip revip + local name ip ips revip config_get name "$cfg" "name" [ -n "$name" ] || return 0 config_get ip "$cfg" "ip" [ -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 "$revip.in-addr.arpa." IN PTR "$name.$domain." + update "$name.$domain." IN A "$ip" + update "$revip.in-addr.arpa." IN PTR "$name.$domain." + done } static_domains() {