isc-dhcp: Use 'append' instead of manually appending

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
Philip Prindeville 2023-09-23 17:09:30 -06:00
parent a6d6475cd5
commit 96e720bb6b
2 changed files with 10 additions and 10 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:=6
PKG_RELEASE:=7
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE

View File

@ -151,7 +151,7 @@ append_routes() {
octets=$((($prefix + 7) / 8))
compacted="$(echo "$network" | cut -d. -f1-$octets)"
routes="$routes${routes:+, }$(explode "$prefix${compacted:+.$compacted}.$router")"
append routes "$(explode "$prefix${compacted:+.$compacted}.$router")" ", "
}
append_dhcp_options() {
@ -174,7 +174,7 @@ append_dhcp_options() {
value="\"$value\""
;;
esac
formatted="$formatted${formatted:+, }$value"
append formatted "$value" ", "
done
echo " option $tag $formatted;"
}
@ -294,17 +294,17 @@ static_host_add() {
for option in $force_send; do
case "$option" in
hostname)
extra_options="$extra_options${extra_options:+,}0c" ;;
append extra_options "0c" "," ;;
domain-name)
extra_options="$extra_options${extra_options:+,}0f" ;;
append extra_options "0f" "," ;;
renewal-time)
extra_options="$extra_options${extra_options:+,}3a" ;;
append extra_options "3a" "," ;;
rebinding-time)
extra_options="$extra_options${extra_options:+,}3b" ;;
append extra_options "3b" "," ;;
fqdn)
extra_options="$extra_options${extra_options:+,}51" ;;
append extra_options "51" "," ;;
routes)
extra_options="$extra_options${extra_options:+,}79" ;;
append extra_options "79" "," ;;
*)
echo "unknown option: $option" >&2 ;;
esac
@ -435,7 +435,7 @@ dhcpd_add() {
local octets="$(rfc1918_prefix "$subnet")"
[ -n "$octets" ] && rfc1918_nets="$rfc1918_nets${rfc1918_nets:+ }$octets"
[ -n "$octets" ] && append rfc1918_nets "$octets"
[ $synthesize -eq 0 ] && return