kea: send subnet renew time if not per host
authorPhilip Prindeville <redacted>
Thu, 15 Jan 2026 01:45:11 +0000 (18:45 -0700)
committerPhilip Prindeville <redacted>
Thu, 9 Apr 2026 23:36:46 +0000 (17:36 -0600)
If the renewal-time isn't set for the host, but it's forced to send,
send the subnet renew time value instead.

Signed-off-by: Philip Prindeville <redacted>
net/kea/files/dhcp4.sh

index 46735f240e8b5bcb5a0bc653630c6b739b57ed4e..615c0ce8ed00f88ecea1ea3896f1b2aa977b0993 100755 (executable)
@@ -548,7 +548,7 @@ static_host_add() {
 
        getvar s_renewal_time "${pfx}_renewal_time"
 
-       config_get renewal_time "$cfg" "renewal_time" "$s_renewal_time"
+       config_get renewal_time "$cfg" "renewal_time"
 
        json_select "$index"            # why "$index" and not "$pfx"?
        json_select "reservations"
@@ -603,8 +603,11 @@ static_host_add() {
                fi
 
                always="$(is_force_send "$force_send" "renewal-time")"
-               ## option_data "name:dhcp-renewal-time" "data:int=$renewal_time" $always
-               option_data "name:dhcp-renewal-time" "data:string=$renewal_time" $always
+               if [ -n "$renewal_time" ]; then
+                       option_data "name:dhcp-renewal-time" "data:string=$renewal_time" $always
+               elif [ -n "$always" ]; then
+                       option_data "name:dhcp-renewal-time" "data:string=$s_renewal_time" $always
+               fi
 
                ### need special handling for list dhcp_option 'option:xxx,yyy'
                config_list_foreach "$cfg" "dhcp_option" append_dhcp_options
git clone https://git.99rst.org/PROJECT