]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2785] Added ChangeLog entry and UT
authorFrancis Dupont <fdupont@isc.org>
Tue, 21 Mar 2023 13:42:38 +0000 (14:42 +0100)
committerFrancis Dupont <fdupont@isc.org>
Fri, 24 Mar 2023 08:56:58 +0000 (09:56 +0100)
ChangeLog
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc

index 63f1017e6c628c72e3ae5e9d7a3b3c69cb55b3bb..7a3e334bee56d4a478658d1f6eb0c1ece7af7108 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2117.  [func]          fdupont
+       Added a new ignore-dhcp-server-identifier DHCPv4 compatibility
+       flag which when set to true (default is false) makes any query
+       to be accepted even when the address in the DHCP Server
+       Identifier option belongs to another server (standard behavior
+       is to drop such queries).
+       (Gitlab #2785)
+
 2116.  [func]          piotrek
        Added support of Secure Zero Touch Provisioning options as per
        RFC8572. Kea can now handle DHCPv4 Option code #143 and DHCPv6
index c4b7064a864ec320e1a31e12464400e0793745a2..56e4209b5bc4c64f9a213afd0710a749b02c66d3 100644 (file)
@@ -2466,6 +2466,9 @@ TEST_F(Dhcpv4SrvTest, buildCfgOptionsList) {
 // identifiers used by a server is accepted,
 // - a message with a server identifier which doesn't match any server
 // identifier used by a server, is not accepted.
+// - a message with a server identifier which doesn't match any server
+// identifier used by a server is accepted when the DHCP Server Identifier
+// option is configured to be ignored.
 TEST_F(Dhcpv4SrvTest, acceptServerId) {
     configureServerIdentifier();
     IfaceMgrTestConfig test_config(true);
@@ -2491,6 +2494,15 @@ TEST_F(Dhcpv4SrvTest, acceptServerId) {
     pkt->addOption(other_serverid);
     EXPECT_FALSE(srv.acceptServerId(pkt));
 
+    // Configure the DHCP Server Identifier to be ignored.
+    ASSERT_FALSE(CfgMgr::instance().getCurrentCfg()->getIgnoreServerIdentifier());
+    CfgMgr::instance().getCurrentCfg()->setIgnoreServerIdentifier(true);
+    EXPECT_TRUE(srv.acceptServerId(pkt));
+
+    // Restore the ignore-dhcp-server-identifier compatibility flag.
+    CfgMgr::instance().getCurrentCfg()->setIgnoreServerIdentifier(false);
+    EXPECT_FALSE(srv.acceptServerId(pkt));
+
     // Remove the server identifier.
     ASSERT_NO_THROW(pkt->delOption(DHO_DHCP_SERVER_IDENTIFIER));