]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4161] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Fri, 7 Nov 2025 16:36:43 +0000 (11:36 -0500)
committerThomas Markwalder <tmark@isc.org>
Fri, 7 Nov 2025 19:34:18 +0000 (19:34 +0000)
modified:   ../../../../changelog_unreleased/4161-address-self-registration-can-not-be-turned-off
modified:   ../../../../doc/sphinx/arm/dhcp6-srv.rst
modified:   ../dhcp6_messages.mes
modified:   ../dhcp6_srv.cc

changelog_unreleased/4161-address-self-registration-can-not-be-turned-off
doc/sphinx/arm/dhcp6-srv.rst
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/dhcp6_srv.cc

index fed253f531201628bc4996129fb0d407868eb085..e4c8ee2a3b7288d9c18b23f77d4554edc4782739 100644 (file)
@@ -2,7 +2,7 @@
        Added a global parameter, "allow-address-registration",
        to kea-dhcp6. It enables or disables client address
        registration (see RFC 9686). It also corrects an
-    issue in which the server was not correctly enforcing
-    a peer address match when ADDR-REG-INFORMs are
-    received via relay.u
+       issue in which the server was not correctly enforcing
+       a peer address match when ADDR-REG-INFORMs are
+       received via relay.
        (Gitlab #4161)
index d8a2fd485581cdbfdfae1b29e65129fffb77bd1d..f36931cfb011ce1aa5cd5d2988ed6cd0db88ed96 100644 (file)
@@ -6918,7 +6918,7 @@ that support address registration to return option 148 to clients that
 request it via the ORO option. As with any other standard option, this
 option must be specified in the server configuration in order to be
 sent to clients and that this behavior is independent of
-``allow-address-resgistration``.
+``allow-address-registration``.
 
 .. note::
 
index c3bd12befd302f2717a456ad23416e1fc5877d99..3195791edcf81436a1d20eb99ac0358e24226d04 100644 (file)
@@ -1184,4 +1184,4 @@ new server id.
 % DHCP6_ADDR6_REGISTER_DISABLED_DROP ADDR-REG-INFORM from %1 was dropped because address registration is disabled.
 Logged at debug log level 40.
 This debug message is printed when the server drops an ADDR-REG-INFORM packet
-because 'allow-address-regisration' is false.
+because 'allow-address-registration' is false.
index ab168c958f0adbcaad92c8d6a77ccb70bde0ae71..6a1b1a9c41611b38e4c70549b4ac6eef2dcc4ff8 100644 (file)
@@ -4558,14 +4558,6 @@ Dhcpv6Srv::processDhcp4Query(const Pkt6Ptr& dhcp4_query) {
 
 Pkt6Ptr
 Dhcpv6Srv::processAddrRegInform(AllocEngine::ClientContext6& ctx) {
-    ConstSubnetPtr subnet = ctx.subnet_;
-    // Silently ignore message which can't be localized
-    if (!subnet) {
-        return (Pkt6Ptr());
-    }
-
-    Pkt6Ptr addr_reg_inf = ctx.query_;
-
     // Get the allow-address-resgistration flag value.
     // If it's false, punt.
     auto allow_address_registration = CfgMgr::instance().getCurrentCfg()->
@@ -4574,11 +4566,22 @@ Dhcpv6Srv::processAddrRegInform(AllocEngine::ClientContext6& ctx) {
     if (allow_address_registration && !allow_address_registration->boolValue()) {
         LOG_DEBUG(packet6_logger, DBG_DHCP6_BASIC, DHCP6_ADDR6_REGISTER_DISABLED_DROP)
                 .arg(addr_reg_inf->getLabel());
+        StatsMgr::instance().addValue("pkt6-admin-filtered",
+                                      static_cast<int64_t>(1));
+
         StatsMgr::instance().addValue("pkt6-receive-drop",
                                       static_cast<int64_t>(1));
         return(Pkt6Ptr());
     }
 
+    ConstSubnetPtr subnet = ctx.subnet_;
+    // Silently ignore message which can't be localized
+    if (!subnet) {
+        return (Pkt6Ptr());
+    }
+
+    Pkt6Ptr addr_reg_inf = ctx.query_;
+
     // Get the client source address.
     IOAddress addr = addr_reg_inf->getRemoteAddr();
     // If there are some relays get the peer address of the closest relay