From 4590decf5bba9c591954c260d0201993aefaf4cd Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Mon, 11 Sep 2023 13:12:39 -0600 Subject: [PATCH 1/2] isc-dhcpd: Generate correct delimiter in hex strings Signed-off-by: Philip Prindeville --- net/isc-dhcp/Makefile | 2 +- net/isc-dhcp/files/dhcpd.init | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile index 8d3be4c91..d7c4a1566 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:=5 +PKG_RELEASE:=6 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 382594484..b0bf809a5 100755 --- a/net/isc-dhcp/files/dhcpd.init +++ b/net/isc-dhcp/files/dhcpd.init @@ -294,17 +294,17 @@ static_host_add() { for option in $force_send; do case "$option" in hostname) - extra_options="$extra_options${extra_options:+ }0c" ;; + extra_options="$extra_options${extra_options:+,}0c" ;; domain-name) - extra_options="$extra_options${extra_options:+ }0f" ;; + extra_options="$extra_options${extra_options:+,}0f" ;; renewal-time) - extra_options="$extra_options${extra_options:+ }3a" ;; + extra_options="$extra_options${extra_options:+,}3a" ;; rebinding-time) - extra_options="$extra_options${extra_options:+ }3b" ;; + extra_options="$extra_options${extra_options:+,}3b" ;; fqdn) - extra_options="$extra_options${extra_options:+ }51" ;; + extra_options="$extra_options${extra_options:+,}51" ;; routes) - extra_options="$extra_options${extra_options:+ }79" ;; + extra_options="$extra_options${extra_options:+,}79" ;; *) echo "unknown option: $option" >&2 ;; esac From 2faa29c550ee28dea0ac1abf2f8621ccf3cf962f Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Mon, 11 Sep 2023 13:59:30 -0600 Subject: [PATCH 2/2] isc-dhcp: Allow per-subnet domain names Signed-off-by: Philip Prindeville --- net/isc-dhcp/files/dhcpd.init | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init index b0bf809a5..967ba83da 100755 --- a/net/isc-dhcp/files/dhcpd.init +++ b/net/isc-dhcp/files/dhcpd.init @@ -393,6 +393,8 @@ gen_dhcp_subnet() { fi echo " option domain-name-servers $DNS;" + [ -n "$domain" ] && echo " option domain-name \"$domain\";" + local routes= config_list_foreach "$cfg" "routes" append_routes [ -n "$routes" ] && echo " option classless-ipv4-route $routes;" @@ -405,7 +407,7 @@ dhcpd_add() { local cfg="$1" synthesize="$2" local dhcp6range="::" local dynamicdhcp defaultroute end gateway ifname ignore leasetime limit net netmask - local proto networkid start subnet + local proto networkid start subnet domain local IP NETMASK BROADCAST NETWORK PREFIX DNS START END config_get_bool ignore "$cfg" "ignore" 0 @@ -462,6 +464,8 @@ dhcpd_add() { gateway="$IP" fi + config_get domain "$cfg" "domain" + gen_dhcp_subnet "$cfg" }