isc-dhcp: Use 'append' instead of manually appending
authorPhilip Prindeville <[email protected]>
Sat, 23 Sep 2023 23:09:30 +0000 (17:09 -0600)
committerPhilip Prindeville <[email protected]>
Mon, 16 Oct 2023 04:17:51 +0000 (22:17 -0600)
Signed-off-by: Philip Prindeville <[email protected]>
net/isc-dhcp/Makefile
net/isc-dhcp/files/dhcpd.init

index d7c4a156614bb375276aa15fb0a7f73447b49424..81fd97681b2de56064358365ed94b75a5b057c70 100644 (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
index 111201009d033e3f88915b3cb37bc96bc1782162..498cf78820d43766312556a8f92ccad9b6d940a5 100755 (executable)
@@ -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