]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1989] Updated ARM
authorThomas Markwalder <tmark@isc.org>
Wed, 4 Dec 2024 20:04:10 +0000 (15:04 -0500)
committerThomas Markwalder <tmark@isc.org>
Fri, 6 Dec 2024 12:49:40 +0000 (12:49 +0000)
Changes to be committed:
    modified:   doc/sphinx/arm/dhcp4-srv.rst
    modified:   doc/sphinx/arm/hooks-ddns-tuning.rst

doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/hooks-ddns-tuning.rst

index e14811511579b733c5071305d36ec1de28868aef..254f9e826877b0154bdd68537cb723a0d1ac8ef1 100644 (file)
@@ -4029,6 +4029,13 @@ qualifying suffix is "example.com", and the default value is used for
 
 ``myhost-172-16-1-10.example.com.``
 
+.. note::
+
+    When the client sends the host name option, ``kea-dhcp4`` never adds a dot to
+    the returned host name. It will only end with a dot if the client sent it
+    already qualified and ending with a dot.  When the client sends the FQDN option,
+    the FQDN returned in the response will always end with a dot.
+
 .. _dhcp4-host-name-sanitization:
 
 Sanitizing Client Host Name and FQDN Names
index 72b2a49e8cb1dd0f2226ae1bc468a6bb25d48b1a..1c28d5033fe3bdb071792c2b5c76124c9340c2e8 100644 (file)
@@ -59,6 +59,23 @@ expression is shown below:
         ...
     }
 
+The default behavior of :iscman:`kea-dhcp4` is to prefer the FQDN option (code 81) over the
+host name option (code 12) when a client sends both.   The following example shows
+the ``hostname-expr`` one would use to reverse this rule:
+
+.. code-block:: javascript
+
+    {
+        "hooks-libraries": [
+            {
+                "library": "/usr/local/lib/libdhcp_ddns_tuning.so",
+                "parameters": {
+                    "hostname-expr" : "ifelse(option[12].exists, option[host-name].text, option[81].text)"
+                }
+            },
+        ],
+    }
+
 It is also possible to define this parameter in a subnet, using the user-context mechanism.
 If defined at the subnet level, the expression applies to a specific subnet only. If the
 subnet expression is defined as empty, ``""``, it suppresses (or disables) the use of a
@@ -73,19 +90,13 @@ global expression for that subnet. An example subnet expression is shown below:
             "pool": "192.0.2.10 - 192.0.2.20"
         } ],
 
-        // This is a subnet-specific user context.
         "user-context": {
             "ddns-tuning": {
                 "hostname-expr": "'guest-'+int8totext(substring(pkt4.yiaddr, 0,1))+'-' \
                                           +int8totext(substring(pkt4.yiaddr, 1,2))+'-' \
                                           +int8totext(substring(pkt4.yiaddr, 2,3))+'-' \
                                           +int8totext(substring(pkt4.yiaddr, 3,4))"
-            },
-            "last-modified": "2017-09-04 13:32",
-            "description": "you can put anything you like here",
-            "phones": [ "x1234", "x2345" ],
-            "devices-registered": 42,
-            "billing": false
+            }
         }
     }],
     ...