]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#225] Updated arm
authorThomas Markwalder <tmark@isc.org>
Tue, 21 Mar 2023 18:59:52 +0000 (14:59 -0400)
committerThomas Markwalder <tmark@isc.org>
Fri, 24 Mar 2023 16:50:00 +0000 (12:50 -0400)
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp4-srv.rst
    updated DDNS parameter doc

Added a ChangeLog entry

ChangeLog
doc/examples/kea4/all-keys.json
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst
src/lib/dhcpsrv/ncr_generator.h

index 7df1bfb1fd725b2cb3bf43f91805a1bd33c7abb6..9a116e157ed710be93135f863cade0deeebccb29 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2119.  [func]          tmark
+       Added a new parameter, ddns-ttl-percent, to kea-dhcp4
+       and kea-dhcp6, that may be used to calculate DNS TTL
+       as a simple percentage of the lease life time.
+       (Gitlab #225)
+
 2118.  [bug]           razvan
        Fixed a bug which was changing the multi-threading settings when
        running config-test command and the settings were different from
index 6d6375893e99ff157956c6637c8c8ef0837f2afb..cfdc08bd6207308e6d0f7336874bd678d35d7ed9 100644 (file)
                 "ddns-use-conflict-resolution": true,
 
                 // Shared network level value. See description at the global level.
-                "ddns-ttl-percent": 0.75,
+                "ddns-ttl-percent": 0.65,
 
                 // Shared network level value. See description at the global level.
                 "hostname-char-replacement": "x",
                         "ddns-use-conflict-resolution": true,
 
                         // Subnet level value. See description at the global level.
-                        "ddns-ttl-percent": 0.75,
+                        "ddns-ttl-percent": 0.55,
 
                         // Subnet level value. See description at the global level.
                         "hostname-char-replacement": "x",
index 7e4184a655d28c0cdf345a6c30ff35a2264ebcb7..895bf21f4c25c747ed6bbc533fbc8fb9dd65545d 100644 (file)
@@ -3369,6 +3369,7 @@ DDNS-related parameters are split into two groups:
     -  ``ddns-qualifying-suffix``
     -  ``ddns-update-on-renew``
     -  ``ddns-use-conflict-resolution``
+    -  ``ddns-ttl-percent``
     -  ``hostname-char-set``
     -  ``hostname-char-replacement``
 
@@ -3408,6 +3409,7 @@ The default configuration and values would appear as follows:
         "ddns-qualifying-suffix": "",
         "ddns-update-on-renew": false,
         "ddns-use-conflict-resolution": true,
+        "ddns-ttl-percent": 0.75,
         "hostname-char-set": "",
         "hostname-char-replacement": ""
         ...
@@ -3492,14 +3494,18 @@ conflict with existing entries owned by other DHCPv4 clients.
     reassigning either FQDNs or IP addresses. Doing so causes ``kea-dhcp4``
     to generate DNS removal requests to D2.
 
-.. note::
-
-    The DNS entries Kea creates contain a value for TTL (time to live). Since
-    Kea 1.9.3, ``kea-dhcp4`` calculates that value based on
-    `RFC 4702, Section 5 <https://tools.ietf.org/html/rfc4702#section-5>`__,
-    which suggests that the TTL value be 1/3 of the lease's lifetime, with
-    a minimum value of 10 minutes. In earlier versions, the server set the TTL value
-    equal to the lease's valid lifetime.
+The DNS entries Kea creates contain a value for TTL (time to live). Since
+Kea 1.9.3, ``kea-dhcp4`` calculates that value based on
+`RFC 4702, Section 5 <https://tools.ietf.org/html/rfc4702#section-5>`__,
+which suggests that the TTL value be 1/3 of the lease's lifetime, with
+a minimum value of 10 minutes. In earlier versions, the server set the
+TTL value equal to the lease's valid lifetime.
+
+Kea 2.3.6 adds a new parameter, ``ddns-ttl-percent``. When specified
+it causes the TTL to be calculated as a simple percentage of the lease's
+life time, using the parameter's value as the percentage. It is specified
+as a decimal percent (e.g. .25, .75, 1.00) and may be specified at the
+global, shared-network, and subnet levels.  By default it is unspecified.
 
 .. _dhcpv4-d2-io-config:
 
index 4d6a48a7cee60d782ad55c31b1c601fe96e0ccd8..f506d317e6b09bc554f7dcc76ef3fabc85a629ae 100644 (file)
@@ -2952,6 +2952,7 @@ DDNS-related parameters are split into two groups:
     -  ``ddns-qualifying-suffix``
     -  ``ddns-update-on-renew``
     -  ``ddns-use-conflict-resolution``
+    -  ``ddns-ttl-percent``
     -  ``hostname-char-set``
     -  ``hostname-char-replacement``
 
@@ -2991,6 +2992,7 @@ The default configuration and values would appear as follows:
         "ddns-qualifying-suffix": "",
         "ddns-update-on-renew": false,
         "ddns-use-conflict-resolution": true,
+        "ddns-ttl-percent": 0.75,
         "hostname-char-set": "",
         "hostname-char-replacement": ""
         ...
@@ -3075,14 +3077,18 @@ conflict with existing entries owned by other DHCPv6 clients.
     reassigning either FQDNs or IP addresses. Doing so causes ``kea-dhcp6``
     to generate DNS removal requests to D2.
 
-.. note::
-
-    The DNS entries Kea creates contain a value for TTL (time to live). Since
-    Kea 1.9.3, ``kea-dhcp6`` calculates that value based on
-    `RFC 4702, Section 5 <https://tools.ietf.org/html/rfc4702#section-5>`__,
-    which suggests that the TTL value be 1/3 of the lease's lifetime, with
-    a minimum value of 10 minutes. In earlier versions, the server set the TTL value
-    equal to the lease's valid lifetime.
+The DNS entries Kea creates contain a value for TTL (time to live). Since
+Kea 1.9.3, ``kea-dhcp6`` calculates that value based on
+`RFC 4702, Section 5 <https://tools.ietf.org/html/rfc4702#section-5>`__,
+which suggests that the TTL value be 1/3 of the lease's lifetime, with
+a minimum value of 10 minutes. In earlier versions, the server set the
+TTL value equal to the lease's valid lifetime.
+
+Kea 2.3.6 adds a new parameter, ``ddns-ttl-percent``. When specified
+it causes the TTL to be calculated as a simple percentage of the lease's
+life time, using the parameter's value as the percentage. It is specified
+as a decimal percent (e.g. .25, .75, 1.00) and may be specified at the
+global, shared-network, and subnet levels.  By default it is unspecified.
 
 .. _dhcpv6-d2-io-config:
 
index 2994481780c2207ca4db012d81c8513ab7b0f271..2011912a781e858ab5627647143514a48b3af677 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2023 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -44,13 +44,17 @@ void queueNCR(const dhcp_ddns::NameChangeType& chg_type, const Lease6Ptr& lease)
 
 /// @brief Calculates TTL for a DNS resource record based on lease life time.
 ///
-/// Per RFC 4702 Section 5, the RR TTL should be calculated as:
-/// TTL = ((lease life time / 3)  < 10 minutes) ? 10 minutes : (lease life time / 3)
+/// If the parameter, ddns_ttl_percent is greater than zero, it is used to calculate
+/// the TTL directly:
+///
+/// TTL = (lease life time * ddns-ttl-percent)
 ///
-/// This function may be expanded in the future to support configurable
-/// parameters.
+/// Otherwise it is calculated as per RFC 4702 Section 5:
+///
+/// TTL = ((lease life time / 3)  < 10 minutes) ? 10 minutes : (lease life time / 3)
 ///
 /// @param lease_life_time valid life time of the lease
+/// @param ddns_ttl_percent optional percentage to use in calculation
 ///
 /// @return the calculated TTL.
 uint32_t calculateDdnsTtl(uint32_t lease_life_time,