From: Thomas Markwalder Date: Fri, 7 Nov 2025 16:36:43 +0000 (-0500) Subject: [#4161] Addressed review comments X-Git-Tag: Kea-3.1.4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9e6236b1bed18388012b061f7e5d08d782f75af;p=thirdparty%2Fkea.git [#4161] Addressed review comments 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 --- diff --git a/changelog_unreleased/4161-address-self-registration-can-not-be-turned-off b/changelog_unreleased/4161-address-self-registration-can-not-be-turned-off index fed253f531..e4c8ee2a3b 100644 --- a/changelog_unreleased/4161-address-self-registration-can-not-be-turned-off +++ b/changelog_unreleased/4161-address-self-registration-can-not-be-turned-off @@ -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) diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index d8a2fd4855..f36931cfb0 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -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:: diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index c3bd12befd..3195791edc 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -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. diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index ab168c958f..6a1b1a9c41 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -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(1)); + StatsMgr::instance().addValue("pkt6-receive-drop", static_cast(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