]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4368] Checkpoint
authorFrancis Dupont <fdupont@isc.org>
Mon, 4 May 2026 07:39:30 +0000 (09:39 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 7 May 2026 14:13:00 +0000 (16:13 +0200)
44 files changed:
src/bin/admin/tests/dhcpdb_create_1.0.mysql
src/bin/admin/tests/dhcpdb_create_1.0.pgsql
src/bin/dhcp6/dhcp6.dox
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/dhcp6_srv.h
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/confirm_unittest.cc
src/bin/dhcp6/tests/dhcp6_client.cc
src/bin/dhcp6/tests/dhcp6_client.h
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/dhcp6_test_utils.cc
src/bin/dhcp6/tests/rebind_unittest.cc
src/bin/perfdhcp/command_options.cc
src/bin/perfdhcp/tests/test_control_unittest.cc
src/hooks/dhcp/lease_query/lease_query_impl6.cc
src/lib/dhcp/dhcp6.h
src/lib/dhcp/duid.h
src/lib/dhcp/duid_factory.h
src/lib/dhcp/iface_mgr.h
src/lib/dhcp/option4_dnr.h
src/lib/dhcp/option6_auth.h
src/lib/dhcp/option6_status_code.h
src/lib/dhcp/option_definition.h
src/lib/dhcp/option_space.h
src/lib/dhcp/option_vendor_class.h
src/lib/dhcp/pkt6.cc
src/lib/dhcpsrv/cfg_duid.h
src/lib/dhcpsrv/flq_allocator.cc
src/lib/dhcpsrv/host.h
src/lib/dhcpsrv/lease.cc
src/lib/dhcpsrv/lease.h
src/lib/dhcpsrv/lease_mgr.cc
src/lib/dhcpsrv/libdhcpsrv.dox
src/lib/dhcpsrv/pool.cc
src/lib/dhcpsrv/sflq_allocator.cc
src/lib/dhcpsrv/subnet.cc
src/lib/dhcpsrv/subnet.h
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
src/lib/dhcpsrv/tests/iterative_allocation_state_unittest.cc
src/lib/dhcpsrv/tests/lease_unittest.cc
src/lib/dhcpsrv/tests/pool_unittest.cc
src/lib/dhcpsrv/tests/shared_network_unittest.cc
src/lib/dhcpsrv/tests/subnet_unittest.cc
src/lib/dhcpsrv/testutils/generic_lease_mgr_unittest.cc

index 181d536ecb3f53aa000b73eb3d30757695383afb..86741a745989a136463167669b29bbf29597f80a 100644 (file)
@@ -55,7 +55,7 @@ CREATE TABLE lease6 (
     pref_lifetime INT UNSIGNED,                 # Preferred lifetime
     lease_type TINYINT,                         # Lease type (see lease6_types
                                                 #    table for possible values)
-    iaid INT UNSIGNED,                          # See Section 12 of RFC 8415
+    iaid INT UNSIGNED,                          # See Section 12 of RFC 9915
     prefix_len TINYINT UNSIGNED,                # For IA_PD only
     fqdn_fwd BOOL,                              # Has forward DNS update been performed by a server
     fqdn_rev BOOL,                              # Has reverse DNS update been performed by a server
index cbe9ff9761046b9f975db7ad7638c50ce431f3de..9b032fe6a6d10939a1cff9ea4808029754cd97a4 100644 (file)
@@ -55,7 +55,7 @@ CREATE TABLE lease6 (
     pref_lifetime BIGINT,                       -- Preferred lifetime
     lease_type SMALLINT,                        -- Lease type (see lease6_types
                                                 --    table for possible values)
-    iaid INT,                                   -- See Section 12 of RFC 8415
+    iaid INT,                                   -- See Section 12 of RFC 9915
     prefix_len SMALLINT,                        -- For IA_PD only
     fqdn_fwd BOOLEAN,                           -- Has forward DNS update been performed by a server
     fqdn_rev BOOLEAN,                           -- Has reverse DNS update been performed by a server
index 3e05606a4574b13d5060fefd8ab1791bd99de594..499971f985156242a3fbe805e8356930af1c6ecc 100644 (file)
@@ -517,7 +517,7 @@ and is described in @ref dhcpv6ClassifierFull.
 
 For each incoming packet, @ref isc::dhcp::Dhcpv6Srv::classifyPacket() method is
 called.  It attempts to extract content of the vendor class option and interprets
-as a name of the class. Although the RFC 8415 says that the vendor class may
+as a name of the class. Although the RFC 9915 says that the vendor class may
 contain more than one chunk of data, the existing code handles only one data
 block, because that is what actual devices use. For now, the code has been
 tested with two classes used in cable modem networks: eRouter1.0 and docsis3.0,
index 4dbf20c8961d7c4f43c738b770894856702de1ab..b2096a7bf119cbd8cf48014042b7b916ac402b8b 100644 (file)
@@ -384,7 +384,7 @@ void Dhcpv6Srv::sendPacket(const Pkt6Ptr& packet) {
 bool
 Dhcpv6Srv::testServerID(const Pkt6Ptr& pkt) {
     /// @todo Currently we always check server identifier regardless if
-    /// it is allowed in the received message or not (per RFC 8415).
+    /// it is allowed in the received message or not (per RFC 9915).
     /// If the server identifier is not allowed in the message, the
     /// sanityCheck function should deal with it.
     OptionPtr server_id = pkt->getOption(D6O_SERVERID);
@@ -407,23 +407,13 @@ Dhcpv6Srv::testServerID(const Pkt6Ptr& pkt) {
 
 bool
 Dhcpv6Srv::testUnicast(const Pkt6Ptr& pkt) const {
-    switch (pkt->getType()) {
-    case DHCPV6_SOLICIT:
-    case DHCPV6_CONFIRM:
-    case DHCPV6_REBIND:
-    case DHCPV6_INFORMATION_REQUEST:
-        if (pkt->relay_info_.empty() && !pkt->getLocalAddr().isV6Multicast()) {
-            LOG_DEBUG(bad_packet6_logger, DBGLVL_PKT_HANDLING, DHCP6_PACKET_DROP_UNICAST)
-                .arg(pkt->getLabel())
-                .arg(pkt->getName());
-            StatsMgr::instance().addValue("pkt6-rfc-violation",
-                                          static_cast<int64_t>(1));
-            return (false);
-        }
-        break;
-    default:
-        // do nothing
-        ;
+    if (pkt->relay_info_.empty() && !pkt->getLocalAddr().isV6Multicast()) {
+       LOG_DEBUG(bad_packet6_logger, DBGLVL_PKT_HANDLING, DHCP6_PACKET_DROP_UNICAST)
+           .arg(pkt->getLabel())
+           .arg(pkt->getName());
+       StatsMgr::instance().addValue("pkt6-rfc-violation",
+                                     static_cast<int64_t>(1));
+       return (false);
     }
     return (true);
 }
@@ -956,8 +946,7 @@ Dhcpv6Srv::processPacket(Pkt6Ptr query) {
     }
 
     // Check if the received query has been sent to unicast or multicast.
-    // The Solicit, Confirm, Rebind and Information Request will be
-    // discarded if sent to unicast address.
+    // All queries per RFC 9915 will be discarded if sent to unicast address.
     if (!testUnicast(query)) {
 
         // Increase the statistic of dropped packets.
@@ -3113,7 +3102,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query,
         setTeeTimes(min_preferred_lft, subnet, ia_rsp);
     } else {
         // The server wasn't able allocate new lease and renew an existing
-        // lease. In that case, the server sends NoAddrsAvail per RFC 8415.
+        // lease. In that case, the server sends NoAddrsAvail per RFC 9915.
         ia_rsp->addOption(createStatusCode(*query, *ia_rsp,
                                            STATUS_NoAddrsAvail,
                                            "Sorry, no addresses could be"
@@ -3142,7 +3131,7 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query,
     // information about client's leases from lease database. We treat this
     // as no binding for the client.
     if (!subnet) {
-        // Per RFC 8415, section 18.3.4, if there is no binding and we are
+        // Per RFC 9915, section 18.3.4, if there is no binding and we are
         // processing a Renew, the NoBinding status code should be returned.
         if (query->getType() == DHCPV6_RENEW) {
             // Insert status code NoBinding
@@ -3151,7 +3140,7 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query,
                                                " for this duid/iaid."));
             return (ia_rsp);
 
-        // Per RFC 8415, section 18.3.5, if there is no binding and we are
+        // Per RFC 9915, section 18.3.5, if there is no binding and we are
         // processing Rebind, the message has to be discarded (assuming that
         // the server doesn't know if the prefix in the IA_PD option is
         // appropriate for the client's link). The exception being thrown
@@ -3165,7 +3154,7 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query,
             /// being able to select the subnet may not be enough, because
             /// there might be other DHCP servers around that are configured
             /// to handle that subnet. Therefore we don't fully follow all
-            /// the paths in section 18.3.5 of RFC 8415 to respond with
+            /// the paths in section 18.3.5 of RFC 9915 to respond with
             /// zero lifetimes for the prefixes being rebound.
             isc_throw(DHCPv6DiscardMessageError, "no subnet found for the"
                       " client sending Rebind to extend lifetime of the"
@@ -3308,7 +3297,7 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query,
     } else {
         // All is left is to insert the status code.
         // The server wasn't able allocate new lease and renew an existing
-        // lease. In that case, the server sends NoPrefixAvail per RFC 8415.
+        // lease. In that case, the server sends NoPrefixAvail per RFC 9915.
         ia_rsp->addOption(createStatusCode(*query, *ia_rsp,
                                            STATUS_NoPrefixAvail,
                                            "Sorry, no prefixes could be"
@@ -3373,7 +3362,7 @@ Dhcpv6Srv::releaseLeases(const Pkt6Ptr& release, Pkt6Ptr& reply,
     // RELEASE message. IA_TA options are ignored.
 
     /// @todo Consider supporting more than one address in a single IA.
-    /// It is allowed by RFC 8415, but it is not widely implemented. The only
+    /// It is allowed by RFC 9915, but it is not widely implemented. The only
     /// software that supports that is Dibbler, but its author seriously doubts
     /// if anyone is really using it. Clients that want more than one address
     /// or prefix just include more instances of IA options.
@@ -4294,7 +4283,7 @@ Dhcpv6Srv::declineIA(const Pkt6Ptr& decline, const DuidPtr& duid,
             LOG_INFO(lease6_logger, DHCP6_DECLINE_FAIL_NO_LEASE)
                 .arg(decline->getLabel()).arg(decline_addr->getAddress().toText());
 
-            // According to RFC 8415, section 18.3.8:
+            // According to RFC 9915, section 18.3.8:
             // "For each IA in the Decline message for which the server has no
             // binding information, the server adds an IA option using the IAID
             // from the Decline message and includes a Status Code option with
@@ -4302,7 +4291,7 @@ Dhcpv6Srv::declineIA(const Pkt6Ptr& decline, const DuidPtr& duid,
             setStatusCode(ia_rsp, createStatusCode(*decline, *ia_rsp, STATUS_NoBinding,
                                   "Server does not know about such an address."));
 
-            // In the same section of RFC 8415:
+            // In the same section of RFC 9915:
             // "The server ignores addresses not assigned to the IAs (though it may"
             // choose to log an error if it finds such addresses)."
             continue; // There may be other addresses.
index 8ad007c9138b007ac9284e1024b970a95e8a5c0e..f37f1d338b639855e816621aac8fcd676e160831 100644 (file)
@@ -330,14 +330,10 @@ protected:
 
     /// @brief Check if the message can be sent to unicast.
     ///
-    /// This function checks if the received message conforms to the section 16
-    /// of RFC 8415 which says that: "A server MUST discard any Solicit, Confirm,
-    /// Rebind or Information-request messages it receives with a Layer 3 unicast
-    /// destination address.
+    /// RFC 9915 updated to refuse all messages from clients.
     ///
     /// @param pkt DHCPv6 message to be checked.
-    /// @return false if the message has been sent to unicast address but it is
-    /// not allowed according to RFC3315, section 15; true otherwise.
+    /// @return false if the message has been sent to unicast address.
     bool testUnicast(const Pkt6Ptr& pkt) const;
 
     /// @brief Verifies if specified packet meets RFC requirements
@@ -421,7 +417,7 @@ protected:
     /// @brief Processes incoming Confirm message and returns Reply.
     ///
     /// This function processes Confirm message from the client according
-    /// to section 18.3.3. of RFC 8415. It discards the Confirm message if
+    /// to section 18.3.3. of RFC 9915. It discards the Confirm message if
     /// the message sent by the client contains no addresses, i.e. it has
     /// no IA_NA options or all IA_NA options contain no IAAddr options.
     ///
@@ -553,7 +549,7 @@ protected:
     /// The behavior of this function is different than @c extendIA_NA in that
     /// when there is no subnet found for the rebinding case, the Rebind message
     /// is discarded by the server. That behavior is based on the following
-    /// statement from the RFC 8415, section 18.3.5:
+    /// statement from the RFC 9915, section 18.3.5:
     ///
     /// "If the server chooses to not include any IAs containing IA Address or
     /// IA Prefix options with lifetimes of 0 and the server does not include
@@ -563,7 +559,7 @@ protected:
     ///
     /// @todo We should consider unification of the server behavior for address
     /// assignment and prefix delegation with respect to Rebind message
-    /// processing. The RFC 8415, section 18.3.5 doesn't really differentiate
+    /// processing. The RFC 9915, section 18.3.5 doesn't really differentiate
     /// between IA_NA and IA_PD in how they should be processed by the server.
     /// The intention of the spec is as follows:
     ///
index f88283b2717c5d8068a29f3458d0bbfa6f87a690..4101c5cd57dcfd0ac739ab29c170299a969d7e62 100644 (file)
@@ -2279,8 +2279,7 @@ TEST_F(Dhcp6ParserTest, multiplePools) {
               pools1[0]->toText());
     EXPECT_EQ("type=IA_NA, 2001:db8:1:0:abcd::-2001:db8:1:0:abcd::ffff, delegated_len=128",
               pools1[1]->toText());
-    // There shouldn't be any TA or PD pools
-    EXPECT_TRUE((*subnet)->getPools(Lease::TYPE_TA).empty());
+    // There shouldn't be any PD pools
     EXPECT_TRUE((*subnet)->getPools(Lease::TYPE_PD).empty());
 
     // Check the second subnet
@@ -2291,8 +2290,7 @@ TEST_F(Dhcp6ParserTest, multiplePools) {
               pools2[0]->toText());
     EXPECT_EQ("type=IA_NA, 2001:db8:2::300-2001:db8:2::3ff, delegated_len=128",
               pools2[1]->toText());
-    // There shouldn't be any TA or PD pools
-    EXPECT_TRUE((*subnet)->getPools(Lease::TYPE_TA).empty());
+    // There shouldn't be any PD pools
     EXPECT_TRUE((*subnet)->getPools(Lease::TYPE_PD).empty());
 }
 
index 2918c2f84201d921244a4004a70508e2abf4bd06..4287900af0f14d1f4626d124c5ea6d9a519d5b4a 100644 (file)
@@ -113,7 +113,7 @@ TEST_F(ConfirmTest, sanityCheck) {
 // Test that directly connected client's Confirm message is processed and Reply
 // message is sent back. In this test case, the client sends Confirm for two
 // addresses that belong to the same IAID and are sent within the same IA_NA
-// option (RFC 8415, section 18.3.3).
+// option (RFC 9915, section 18.3.3).
 TEST_F(ConfirmTest, directClientSameIAID) {
     Dhcp6Client client(srv_);
     // Configure client to request IA_NA.
@@ -155,7 +155,7 @@ TEST_F(ConfirmTest, directClientSameIAID) {
 // Test that directly connected client's Confirm message is processed and Reply
 // message is sent back. In this test case, the client sends Confirm for two
 // addresses that belong to different IAIDs and are sent within the different
-// IA_NA options (RFC 8415, section 18.3.3).
+// IA_NA options (RFC 9915, section 18.3.3).
 TEST_F(ConfirmTest, directClientDifferentIAID) {
     Dhcp6Client client(srv_);
     // Configure client to request IA_NA.
@@ -201,7 +201,7 @@ TEST_F(ConfirmTest, directClientDifferentIAID) {
 
 
 // Test that relayed client's Confirm message is processed and Reply message
-// is sent back (RFC 8415, section 18.3.3).
+// is sent back (RFC 9915, section 18.3.3).
 TEST_F(ConfirmTest, relayedClient) {
     Dhcp6Client client(srv_);
     // Client to send relayed message.
@@ -243,7 +243,7 @@ TEST_F(ConfirmTest, relayedClient) {
 }
 
 // Test that the Confirm message without any addresses is discarded
-// (RFC 8415, section 18.3.3).
+// (RFC 9915, section 18.3.3).
 TEST_F(ConfirmTest, relayedClientNoAddress) {
     Dhcp6Client client(srv_);
     // Configure the server.
@@ -261,7 +261,7 @@ TEST_F(ConfirmTest, relayedClientNoAddress) {
 }
 
 // This test checks that the server processes Confirm message correctly if
-// the subnet can't be selected for the client (RFC 8415, section 18.3.3).
+// the subnet can't be selected for the client (RFC 9915, section 18.3.3).
 TEST_F(ConfirmTest, relayedClientNoSubnet) {
     Dhcp6Client client(srv_);
     // Client to send relayed message.
@@ -327,7 +327,7 @@ TEST_F(ConfirmTest, relayedUnicast) {
 }
 
 // This test checks that the Confirm message is discarded by the server if it
-// has been sent to unicast address (RFC 8415, section 18.3.3).
+// has been sent to unicast address (RFC 9915, section 18).
 TEST_F(ConfirmTest, unicast) {
     Dhcp6Client client(srv_);
     // Configure client to request IA_NA.
index 174d4dcff121299f4ca3b9f9be3c43d54f024cb1..d9cc31caa4ddcf8dce524fad668e4ffd44c888f2 100644 (file)
@@ -514,7 +514,7 @@ Dhcp6Client::doRenew() {
     copyIAsFromLeases(query);
 
     // During the Renew the client may request additional bindings per
-    // RFC 8415.
+    // RFC 9915.
     appendRequestedIAs(query);
 
     context_.query_ = query;
@@ -538,7 +538,7 @@ Dhcp6Client::doRebind() {
     copyIAsFromLeases(query);
 
     // During the Rebind the client may request additional bindings per
-    // RFC 8415.
+    // RFC 9915.
     appendRequestedIAs(query);
 
     // Add Client FQDN if configured.
index 8237e3a7260dd5aa34cc9e5085e190843e921aa1..7f6e4c066cbc4b496223672f1a9c55d460712913 100644 (file)
@@ -606,7 +606,7 @@ public:
     ///
     /// This method is typically called to specify IA_NA options to be
     /// sent to the server during 4-way handshakes and during lease
-    /// renewal to request allocation of new leases (as per RFC 8415).
+    /// renewal to request allocation of new leases (as per RFC 9915).
     ///
     /// @param iaid IAID.
     /// @param address IPv6 address to be included in the IA_NA. It defaults
@@ -627,7 +627,7 @@ public:
     ///
     /// This method is typically called to specify IA_PD options to be
     /// sent to the server during 4-way handshakes and during lease
-    /// renewal to request allocation of new leases (as per RFC 8415).
+    /// renewal to request allocation of new leases (as per RFC 9915).
     ///
     /// @param iaid IAID.
     /// @param prefix_len Prefix length.
index aae3b34eda721bfaf3897365bd7558cb55c05276..f03b50546943836482ecb4684852c8d8fd440bc8 100644 (file)
@@ -669,7 +669,7 @@ TEST_F(Dhcpv6SrvTest, DUID) {
 
         // No failure here. There's really no way for test LL DUID. It doesn't
         // even make sense to check if that Link Layer is actually present on
-        // a physical interface. RFC 8415 says a server should write its DUID
+        // a physical interface. RFC 9915 says a server should write its DUID
         // and keep it despite hardware changes.
         break;
     }
@@ -2506,8 +2506,12 @@ TEST_F(Dhcpv6SrvTest, testUnicast) {
     // sent to unicast address.
     const uint8_t not_allowed_unicast[] = {
         DHCPV6_SOLICIT,
+        DHCPV6_REQUEST,
         DHCPV6_CONFIRM,
+        DHCPV6_RENEW,
         DHCPV6_REBIND,
+        DHCPV6_RELEASE,
+        DHCPV6_DECLINE,
         DHCPV6_INFORMATION_REQUEST
     };
     // Iterate over these messages and make sure they are discarded.
@@ -2517,8 +2521,8 @@ TEST_F(Dhcpv6SrvTest, testUnicast) {
         EXPECT_FALSE(srv_->testUnicast(msg))
             << "server accepts message type "
             << static_cast<int>(not_allowed_unicast[i])
-            << "being sent to unicast address; this message should"
-            " be discarded according to section 18.4 of RFC 8415";
+            << " being sent to unicast address; this message should"
+            " be discarded according to section 18 of RFC 9915";
     }
 
     // The pkt6-rfc-violation stat should be bumped by one each time.
@@ -2530,10 +2534,6 @@ TEST_F(Dhcpv6SrvTest, testUnicast) {
     // Explicitly list client/relay message types which are allowed to
     // be sent to unicast.
     const uint8_t allowed_unicast[] = {
-        DHCPV6_REQUEST,
-        DHCPV6_RENEW,
-        DHCPV6_RELEASE,
-        DHCPV6_DECLINE,
         DHCPV6_RELAY_FORW
     };
     // Iterate over these messages and check that they are accepted being
@@ -2541,11 +2541,15 @@ TEST_F(Dhcpv6SrvTest, testUnicast) {
     for (size_t i = 0; i < sizeof(allowed_unicast); ++i) {
         Pkt6Ptr msg = Pkt6Ptr(new Pkt6(allowed_unicast[i], 1234));
         msg->setLocalAddr(IOAddress("2001:db8:1::1"));
-        msg->addOption(srv_->getServerID());
+        Pkt6::RelayInfo relay;
+        relay.linkaddr_ = IOAddress("2001:db8:2::1234");
+        relay.peeraddr_ = IOAddress("fe80::1");
+        // In fact what matters is the packet was relayed...
+        msg->relay_info_.push_back(relay);
         EXPECT_TRUE(srv_->testUnicast(msg))
             << "server doesn't accept message type "
             << static_cast<int>(allowed_unicast[i])
-            << "being sent to unicast address";
+            << " being sent to unicast address";
     }
 }
 
index 742c2cb5a434560e3045d8a44f65218eb4e0512e..068454d65c5b74f0118015439b3b9cdbcb135815 100644 (file)
@@ -667,7 +667,7 @@ Dhcpv6SrvTest::testReleaseBasic(Lease::Type type, const IOAddress& existing,
     checkIA_NAStatusCode(ia, STATUS_Success, 0, 0);
     checkMsgStatusCode(reply, STATUS_Success);
 
-    // There should be no address returned in RELEASE (see RFC 8415, 18.3.7)
+    // There should be no address returned in RELEASE (see RFC 9915, 18.3.7)
     // There should be no prefix
     EXPECT_FALSE(tmp->getOption(D6O_IAADDR));
     EXPECT_FALSE(tmp->getOption(D6O_IAPREFIX));
@@ -836,7 +836,7 @@ Dhcpv6SrvTest::testReleaseAndReclaim(Lease::Type type) {
     checkIA_NAStatusCode(ia, STATUS_Success, 0, 0);
     checkMsgStatusCode(reply, STATUS_Success);
 
-    // There should be no address returned in RELEASE (see RFC 8415, 18.3.7)
+    // There should be no address returned in RELEASE (see RFC 9915, 18.3.7)
     // There should be no prefix
     EXPECT_FALSE(tmp->getOption(D6O_IAADDR));
     EXPECT_FALSE(tmp->getOption(D6O_IAPREFIX));
index 7399833a29e4f421fc111bf6470640cad5fd8870..7e7aede22d2a689000d3b1e0113bed0929cfca0c 100644 (file)
@@ -809,7 +809,7 @@ TEST_F(RebindTest, directClientPDChangingPrefix) {
     client.config_.leases_[0].addr_ = IOAddress("2001:db8:1:10::");
     // Try to Rebind. The client will use correct IAID but will specify a
     // wrong prefix. The server will discover that the client has a binding
-    // but the prefix will not match. According to the RFC 8415, section 18.3.5
+    // but the prefix will not match. According to the RFC 9915, section 18.3.5
     // the server may return delegated prefix with lifetime of 0 when it
     // finds that the lease entry for the particular IAID but the prefix
     // is not appropriate. This constitutes explicit notification to the
@@ -850,7 +850,7 @@ TEST_F(RebindTest, directClientPDChangingPrefix) {
 /// @todo Extend PD tests to cover same prefix by different length.
 
 // This test checks that the Rebind message is discarded by the server if it
-// has been sent to unicast address (RFC 8415, section 18.4).
+// has been sent to unicast address (RFC 9915, section 18).
 TEST_F(RebindTest, unicast) {
     Dhcp6Client client(srv_);
     // Configure client to request IA_NA.
@@ -861,7 +861,7 @@ TEST_F(RebindTest, unicast) {
     Lease6 lease_client = client.getLease(0);
     // Set the unicast destination address for the Rebind message.
     // The Rebind should be discarded when sent to unicast address,
-    // according to section 18.4 of RFC 8415.
+    // according to section 18 of RFC 9915.
     client.setDestAddress(IOAddress("2001:db8:1::1"));
     // Send the Rebind message to a unicast address.
     ASSERT_NO_THROW(client.doRebind());
index c6ef8c0071e8a168a6aecf31dc75a59f498d5875..6d9599785045b13ad84247685fdf01ba027397a1 100644 (file)
@@ -703,7 +703,7 @@ CommandOptions::initialize(int argc, char** argv, bool print_cmd_line) {
     }
 
     // Get server argument
-    // NoteFF02::1:2 and FF02::1:3 are defined in RFC 8415 as
+    // NoteFF02::1:2 and FF02::1:3 are defined in RFC 9915 as
     // All_DHCP_Relay_Agents_and_Servers and All_DHCP_Servers
     // addresses
     check(optind < argc -1, "extra arguments?");
@@ -892,7 +892,7 @@ CommandOptions::generateDuidTemplate() {
     duid_template_[2] = HWTYPE_ETHERNET >> 8;
     duid_template_[3] = HWTYPE_ETHERNET & 0xff;
 
-    // As described in RFC 8415: 'the time value is the time
+    // As described in RFC 9915: 'the time value is the time
     // that the DUID is generated represented in seconds
     // since midnight (UTC), January 1, 2000, modulo 2^32.'
     ptime now = microsec_clock::universal_time();
index 2c0037e3377c2c63a878311b027a58cea763bf5b..3bbaf30a9d80bdbbc97fe7c4447405ec53bd609f 100644 (file)
@@ -404,7 +404,7 @@ public:
             EXPECT_TRUE(std::equal(new_duid.begin(), new_duid.begin() + 4,
                                    duid_llt_and_hw));
 
-            // As described in RFC 8415: 'the time value is the time
+            // As described in RFC 9915: 'the time value is the time
             // that the DUID is generated represented in seconds
             // since midnight (UTC), January 1, 2000, modulo 2^32.'
             uint32_t duid_time = 0;
index 3a5ec8e5116ec874d95397c31e011f036d5f43f2..de03cb01761411b6c17059a1ce33e8ab0666bd6e 100644 (file)
@@ -943,7 +943,7 @@ LeaseQueryImpl6::makeRelayOption(const Lease6& lease) {
     for (size_t i = 0; i < relay_infos.size(); ++i) {
         RelayInfoPtr relay = relay_infos[i];
 
-        // build relay-forw/relay-repl header (see RFC 8415, section 9)
+        // build relay-forw/relay-repl header (see RFC 9915, section 9)
         buffer_out.writeUint8(DHCPV6_RELAY_FORW);
         buffer_out.writeUint8(relay->hop_count_);
         buffer_out.writeData(&(relay->linkaddr_.toBytes()[0]),
index 788f065ad7c8d03193768b68d1933b3befeeaf78..5756f6760e31f3bc7475d54f0045a1bb769c47c0 100644 (file)
 
 /* DHCPv6 Option codes: */
 enum DHCPv6OptionType {
-   D6O_CLIENTID                            = 1, /* RFC8415 */
-   D6O_SERVERID                            = 2, /* RFC8415 */
-   D6O_IA_NA                               = 3, /* RFC8415 */
-   D6O_IA_TA                               = 4, /* RFC8415 */
-   D6O_IAADDR                              = 5, /* RFC8415 */
-   D6O_ORO                                 = 6, /* RFC8415 */
-   D6O_PREFERENCE                          = 7, /* RFC8415 */
-   D6O_ELAPSED_TIME                        = 8, /* RFC8415 */
-   D6O_RELAY_MSG                           = 9, /* RFC8415 */
+   D6O_CLIENTID                            = 1, /* RFC9915 */
+   D6O_SERVERID                            = 2, /* RFC9915 */
+   D6O_IA_NA                               = 3, /* RFC9915 */
+   D6O_IA_TA                               = 4, /* RFC9915 (deprecated) */
+   D6O_IAADDR                              = 5, /* RFC9915 */
+   D6O_ORO                                 = 6, /* RFC9915 */
+   D6O_PREFERENCE                          = 7, /* RFC9915 */
+   D6O_ELAPSED_TIME                        = 8, /* RFC9915 */
+   D6O_RELAY_MSG                           = 9, /* RFC9915 */
    // Option code 10 is unassigned.
-   D6O_AUTH                                = 11, /* RFC8415 */
-   D6O_UNICAST                             = 12, /* RFC8415 */
-   D6O_STATUS_CODE                         = 13, /* RFC8415 */
-   D6O_RAPID_COMMIT                        = 14, /* RFC8415 */
-   D6O_USER_CLASS                          = 15, /* RFC8415 */
-   D6O_VENDOR_CLASS                        = 16, /* RFC8415 */
-   D6O_VENDOR_OPTS                         = 17, /* RFC8415 */
-   D6O_INTERFACE_ID                        = 18, /* RFC8415 */
-   D6O_RECONF_MSG                          = 19, /* RFC8415 */
-   D6O_RECONF_ACCEPT                       = 20, /* RFC8415 */
+   D6O_AUTH                                = 11, /* RFC9915 */
+   D6O_UNICAST                             = 12, /* RFC9915 (deprecated) */
+   D6O_STATUS_CODE                         = 13, /* RFC9915 */
+   D6O_RAPID_COMMIT                        = 14, /* RFC9915 */
+   D6O_USER_CLASS                          = 15, /* RFC9915 */
+   D6O_VENDOR_CLASS                        = 16, /* RFC9915 */
+   D6O_VENDOR_OPTS                         = 17, /* RFC9915 */
+   D6O_INTERFACE_ID                        = 18, /* RFC9915 */
+   D6O_RECONF_MSG                          = 19, /* RFC9915 */
+   D6O_RECONF_ACCEPT                       = 20, /* RFC9915 */
    D6O_SIP_SERVERS_DNS                     = 21, /* RFC3319 */
    D6O_SIP_SERVERS_ADDR                    = 22, /* RFC3319 */
    D6O_NAME_SERVERS                        = 23, /* RFC3646 */
    D6O_DOMAIN_SEARCH                       = 24, /* RFC3646 */
-   D6O_IA_PD                               = 25, /* RFC8415, RFC3633 */
-   D6O_IAPREFIX                            = 26, /* RFC8415, RFC3633 */
+   D6O_IA_PD                               = 25, /* RFC9915, RFC3633 */
+   D6O_IAPREFIX                            = 26, /* RFC9915, RFC3633 */
    D6O_NIS_SERVERS                         = 27, /* RFC3898 */
    D6O_NISP_SERVERS                        = 28, /* RFC3898 */
    D6O_NIS_DOMAIN_NAME                     = 29, /* RFC3898 */
    D6O_NISP_DOMAIN_NAME                    = 30, /* RFC3898 */
    D6O_SNTP_SERVERS                        = 31, /* RFC4075 */
-   D6O_INFORMATION_REFRESH_TIME            = 32, /* RFC8415, RFC4242 */
+   D6O_INFORMATION_REFRESH_TIME            = 32, /* RFC9915, RFC4242 */
    D6O_BCMCS_SERVER_D                      = 33, /* RFC4280 */
    D6O_BCMCS_SERVER_A                      = 34, /* RFC4280 */
    // Option code 35 is unassigned.
@@ -99,8 +99,8 @@ enum DHCPv6OptionType {
    D6O_CLIENT_LINKLAYER_ADDR               = 79, /* RFC6939 */
    D6O_LINK_ADDRESS                        = 80, /* RFC6977 */
 // D6O_RADIUS                              = 81, /* RFC7037 */
-   D6O_SOL_MAX_RT                          = 82, /* RFC8415, RFC7083 */
-   D6O_INF_MAX_RT                          = 83, /* RFC8415, RFC7083 */
+   D6O_SOL_MAX_RT                          = 82, /* RFC9915, RFC7083 */
+   D6O_INF_MAX_RT                          = 83, /* RFC9915, RFC7083 */
 // D6O_ADDRSEL                             = 84, /* RFC7078 */
 // D6O_ADDRSEL_TABLE                       = 85, /* RFC7078 */
 // D6O_V6_PCP_SERVER                       = 86, /* RFC7291 */
@@ -178,7 +178,7 @@ enum DHCPv6StatusCode {
    STATUS_NoAddrsAvail               = 2,
    STATUS_NoBinding                  = 3,
    STATUS_NotOnLink                  = 4,
-   STATUS_UseMulticast               = 5,
+   STATUS_UseMulticast               = 5,  // deprecated
    STATUS_NoPrefixAvail              = 6,
    STATUS_UnknownQueryType           = 7,
    STATUS_MalformedQuery             = 8,
index 2239c232c2cecb37b784d49c99eb5bfb60bbdf3e..cb0a4a56c88aca04dfd9f924b3f8023986f9baf5 100644 (file)
@@ -144,13 +144,13 @@ public:
 
     /// @brief minimum duid size
     ///
-    /// The minimal DUID size specified in RFC 8415, section 11.1 is 3:
+    /// The minimal DUID size specified in RFC 9915, section 11.1 is 3:
     /// 2 fixed octets for the type + 1 minimum octet for the value.
     static constexpr size_t MIN_DUID_LEN = IdentifierType::getMinSize();
 
     /// @brief maximum duid size
     ///
-    /// The maximum DUID size specified in RFC 8415, section 11.1 is 130:
+    /// The maximum DUID size specified in RFC 9915, section 11.1 is 130:
     /// 2 fixed octets for the type + 128 maximum octets for the value.
     static constexpr size_t MAX_DUID_LEN = IdentifierType::getMaxSize();
 
index 4ad0cc47006fb07249894105bec4e0929b616538..2b8ed4225ef2fb7987841a27e323507ad2b17bbe 100644 (file)
@@ -18,9 +18,9 @@ namespace dhcp {
 
 /// @brief Factory for generating DUIDs (DHCP Unique Identifiers).
 ///
-/// DHCPv6 clients and servers are identified by DUIDs (see RFC 8415).
+/// DHCPv6 clients and servers are identified by DUIDs (see RFC 9915).
 /// DUIDs are unique identifiers carried in the appropriate DHCP
-/// options. RFC 8415 defines 4 types of DUIDs:
+/// options. RFC 9915 defines 4 types of DUIDs:
 /// -# DUID-LLT
 /// -# DUID-EN
 /// -# DUID-LL
@@ -28,7 +28,7 @@ namespace dhcp {
 ///
 /// of which the DUID-LLT is recommended for all general purpose computing
 /// devices. Future specifications may define new DUID types. The current
-/// implementation of the class only supports DUID types defined in RFC 8415.
+/// implementation of the class only supports DUID types defined in RFC 9915.
 ///
 /// In most cases DUIDs can be generated automatically, i.e. no manual
 /// configuration is required. For example, DUID-LLT is composed of the
index 2e6e5f1565b4da91ba3f8fb8ed93abbb7ff97fa7..111461f85b4984cfe033cf5094778705f000e5c4 100644 (file)
@@ -788,7 +788,7 @@ public:
 
     /// @brief Packet reception buffer size
     ///
-    /// RFC 8415 states that server responses may be
+    /// RFC 9915 states that server responses may be
     /// fragmented if they are over MTU. There is no
     /// text whether client's packets may be larger
     /// than 1500. For now, we can assume that
index 97095db3da073079ed3e31f1638912418377b695..30f9d483a163495bf1af1b8c2701bdef002bd4ab 100644 (file)
@@ -334,7 +334,7 @@ protected:
     ///
     /// Authentication domain name field of variable length holding
     /// a fully qualified domain name of the encrypted DNS resolver.
-    /// This field is formatted as specified in Section 10 of RFC8415.
+    /// This field is formatted as specified in Section 10 of RFC9915.
     boost::shared_ptr<isc::dns::Name> adn_;
 
     /// @brief Length of all following data inside this DNR instance in octets.
index fe2a4d5dc22147fe06d63c10697000e72b679c6f..70c05e6d6a0cc409b71ec3e2f2a45f93b4484875 100644 (file)
@@ -23,7 +23,7 @@ typedef boost::shared_ptr<Option6Auth> Option6AuthPtr;
 
 /// @brief This class represents Authentication (11) DHCPv6 option.
 ///
-/// For details, see RFC 8415 Section 21.11.
+/// For details, see RFC 9915 Section 21.11.
 class Option6Auth: public Option {
 
 public:
index f133c5d7b8b13b2a4bdc933b3db5c7c001b59c91..959ce7f3dd94b1e4f68a12c282939a64901c2016 100644 (file)
@@ -20,7 +20,7 @@ class Option6StatusCode;
 /// @brief Pointer to the @c isc::dhcp::Option6StatusCode.
 typedef boost::shared_ptr<Option6StatusCode> Option6StatusCodePtr;
 
-/// @brief This class represents Status Code option (13) from RFC 8415.
+/// @brief This class represents Status Code option (13) from RFC 9915.
 class Option6StatusCode: public Option {
 public:
     /// @brief Constructor, used for options constructed (during transmission).
index a02351323fdfe12bbead95f1b0ba9bde0f687f93..ec265cd6df1ea93acd82253dda533795f631a20d 100644 (file)
@@ -88,7 +88,7 @@ class OptionIntArray;
 /// this is a single value the option type points to the data type of the
 /// value. For example, DHCPv6 option 8 comprises a two-byte option code, a
 /// two-byte option length and two-byte field that carries a uint16 value
-/// (RFC 8415 - http://ietf.org/rfc/rfc8415.txt).  In such a case, the option
+/// (RFC 9915 - http://ietf.org/rfc/rfc9915.txt).  In such a case, the option
 /// type is defined as "uint16". Length and string tuples are a length
 /// on one (DHCPv4) or two (DHCPv6) bytes followed by a string of
 /// the given length.
@@ -98,7 +98,7 @@ class OptionIntArray;
 ///
 /// Array types should be used when the option contains multiple contiguous
 /// data values of the same type laid. For example, DHCPv6 option 6 includes
-/// multiple fields holding uint16 codes of requested DHCPv6 options (RFC 8415).
+/// multiple fields holding uint16 codes of requested DHCPv6 options (RFC 9915).
 /// Such an option can be represented with this class by setting the option
 /// type to "uint16" and the array indicator (array_type) to true.  The number
 /// of elements in the array is effectively unlimited (although it is actually
index 50f7cc3e3f804b91038a58988d5f8e4ce2d61b9d..e7066ceddacbcd29403af854a32f4e8b7534e036 100644 (file)
@@ -123,7 +123,7 @@ private:
 /// This class extends the base class with the support for enterprise numbers.
 /// The enterprise numbers are assigned by IANA to various organizations
 /// and they are carried as uint32_t integers in DHCPv6 Vendor Specific
-/// Information Options (VSIO). For more information refer to RFC 8415.
+/// Information Options (VSIO). For more information refer to RFC 9915.
 /// All option spaces that group VSIO options must have enterprise number
 /// set. It can be set using a constructor or \ref setVendorSpace function.
 /// The extra functionality of this class (enterprise numbers) allows to
index c2383c191870c4c1b082ab8294c7971d5565bc2b..c1be25771dd64172172b446005284f4da19024f6 100644 (file)
@@ -23,7 +23,7 @@ namespace dhcp {
 /// Class options.
 ///
 /// The format of DHCPv6 Vendor Class option (16) is described in section 21.16
-/// of RFC 8415 and the format of the DHCPv4 V-I Vendor Class option (124) is
+/// of RFC 9915 and the format of the DHCPv4 V-I Vendor Class option (124) is
 /// described in section 3 of RFC3925. Each of these options carries enterprise
 /// id followed by the collection of tuples carrying opaque data. A single tuple
 /// consists of the field holding opaque data length and the actual data.
@@ -169,7 +169,7 @@ private:
     ///
     /// For DHCPv6, The Vendor Class option mandates a 2-byte
     /// OPTION_VENDOR_CLASS followed by a 2-byte option-len with a 4-byte
-    /// enterprise-number.  While section 21.16 of RFC 8415 specifies that the
+    /// enterprise-number.  While section 21.16 of RFC 9915 specifies that the
     /// information contained within the data area can contain one or more
     /// opaque fields, the inclusion of the vendor-class-data is not mandatory
     /// and therefore not factored into the overall possible minimum length.
index 999c4a5304c827afcc4cc7a50954f6ec5ca407ba..fec9c729b6f43b64aeb86e04e2833fa48908d328 100644 (file)
@@ -406,7 +406,7 @@ Pkt6::packUDP() {
             // Now for each relay, we need to...
             for (auto const& relay : relay_info_) {
 
-                // build relay-forw/relay-repl header (see RFC 8415, section 9)
+                // build relay-forw/relay-repl header (see RFC 9915, section 9)
                 buffer_out_.writeUint8(relay.msg_type_);
                 buffer_out_.writeUint8(relay.hop_count_);
                 buffer_out_.writeData(&(relay.linkaddr_.toBytes()[0]),
index 6897ee65a4e39b379a2048de42fe023c140c0aac..a804d51ceaad78afb107ded8763220403153b3d4 100644 (file)
@@ -22,7 +22,7 @@ namespace dhcp {
 /// The DHCPv6 server uses DHCPv6 Unique Identifier (DUID) to identify itself
 /// to the clients. Typically, the server generates the DUID on the first
 /// startup and writes it to the persistent storage so as it doesn't change
-/// across restarts of the server. RFC 8415 defines different DUID types.
+/// across restarts of the server. RFC 9915 defines different DUID types.
 /// Kea allows for selecting a type of DUID that the server should generate.
 /// It also allows for overriding entire default DUID or parts of it via
 /// configuration file. This class holds the DUID configuration specified
index 663581563344301b4ea81e1ddc42f10c9acaf8a7..f2140014d38c242cf299cefaa7dda66aab7f3351 100644 (file)
@@ -265,7 +265,6 @@ FreeLeaseQueueAllocator::initAfterConfigureInternal() {
         populateFreeAddressLeases(leases4, pools);
         break;
     case Lease::TYPE_NA:
-    case Lease::TYPE_TA:
         leases6 = LeaseMgrFactory::instance().getLeases6(subnet->getID());
         populateFreeAddressLeases(leases6, pools);
         break;
index 63a84b04fafa08a09aeec162640fedf9743b52fc..a61e75d2b37757073291d5481a38aa83fed0dbbb 100644 (file)
@@ -828,7 +828,7 @@ private:
     ///
     /// key is a 16 byte value to be used in the authentication field.
     /// Server replies will contain the below key in authentication field
-    /// as specified in the RFC 8415. While sending reconfigure message
+    /// as specified in the RFC 9915. While sending reconfigure message
     /// authentication field shall contain MD5 hash computed using this key.
     AuthKey key_;
 };
index 1dccb5cec12346142326235c94ac4201141dc197..9ecbcb43e96ba93df48ff538369fb0324ed780bb 100644 (file)
@@ -59,8 +59,6 @@ Lease::typeToText(Lease::Type type) {
        return string("V4");
    case Lease::TYPE_NA:
        return string("IA_NA");
-   case Lease::TYPE_TA:
-       return string("IA_TA");
    case Lease::TYPE_PD:
        return string("IA_PD");
        break;
@@ -80,9 +78,6 @@ Lease::textToType(const std::string& text) {
     } else  if (text == "IA_NA") {
         return (TYPE_NA);
 
-    } else if (text == "IA_TA") {
-        return (TYPE_TA);
-
     } else if (text == "IA_PD") {
         return (TYPE_PD);
     }
index 669e89be1b1291f8185557e6d191863c87c870fd..af874e6f4c292822da35bcd05eb7cf4ac35d6021 100644 (file)
@@ -45,7 +45,7 @@ struct Lease : public isc::data::UserContext, public isc::data::CfgToElement {
     /// @brief Type of lease or pool
     enum Type : uint16_t {
         TYPE_NA = 0, ///< the lease contains non-temporary IPv6 address
-        TYPE_TA = 1, ///< the lease contains temporary IPv6 address
+        TYPE_TA = 1, ///< deprecated (temporary IPv6 address)
         TYPE_PD = 2, ///< the lease contains IPv6 prefix (for prefix delegation)
         TYPE_V4 = 3, ///< IPv4 lease
     };
index 9df33ef49550cf24985fd433e50428d67cad02d1..670cac00e44114ca8dbc3e32bd87b08d713601ed 100644 (file)
@@ -485,7 +485,6 @@ LeaseMgr::recountLeaseStats6() {
                 break;
 
             default:
-                // We don't support TYPE_TAs yet
                 break;
         }
     }
@@ -534,7 +533,6 @@ LeaseMgr::recountLeaseStats6() {
                 break;
 
             default:
-                // We don't support TYPE_TAs yet
                 break;
         }
     }
index 311f7fb564b88c327065987ab52612401d6f94e8..da792e57d5fdde63fbcf034306476f4b24bb8d9d 100644 (file)
@@ -249,9 +249,9 @@ or DUID) values may trigger short cycles.
 @subsection allocEngineTypes Different lease types support
 
 Allocation Engine has been extended to support different types of leases. Four
-types are supported: TYPE_V4 (IPv4 addresses), TYPE_NA (normal IPv6 addresses),
-TYPE_TA (temporary IPv6 addresses) and TYPE_PD (delegated prefixes). Support for
-TYPE_TA is partial. Some routines are able to handle it, while other are
+types are supported: TYPE_V4 (IPv4 addresses), TYPE_NA (normal IPv6 addresses)
+and TYPE_PD (delegated prefixes).
+Some routines are able to handle it, while other are
 not. The major missing piece is the RandomAllocator, so there is no way to randomly
 generate an address. This defeats the purpose of using temporary addresses for now.
 
index 7c671959df14b95456df1c7773d96a49f55c9c81..f5f1685d6002df7d20de9f9968bd39da79a8cffa 100644 (file)
@@ -255,10 +255,9 @@ Pool6::Pool6(Lease::Type type, const isc::asiolink::IOAddress& first,
         isc_throw(BadValue, "Invalid Pool6 address boundaries: not IPv6");
     }
 
-    if ((type != Lease::TYPE_NA) && (type != Lease::TYPE_TA) &&
-        (type != Lease::TYPE_PD)) {
+    if ((type != Lease::TYPE_NA) && (type != Lease::TYPE_PD)) {
         isc_throw(BadValue, "Invalid Pool6 type: " << static_cast<int>(type)
-                  << ", must be TYPE_IA, TYPE_TA or TYPE_PD");
+                  << ", must be TYPE_IA or TYPE_PD");
     }
 
     if (last < first) {
@@ -275,9 +274,9 @@ Pool6::Pool6(Lease::Type type, const isc::asiolink::IOAddress& first,
     }
 
     // TYPE_PD is not supported by this constructor. first-last style
-    // parameters are for IA and TA only. There is another dedicated
+    // parameters are for NA only. There is another dedicated
     // constructor for that (it uses prefix/length)
-    if ((type != Lease::TYPE_NA) && (type != Lease::TYPE_TA)) {
+    if (type != Lease::TYPE_NA) {
         isc_throw(BadValue, "Invalid Pool6 type specified: "
                   << static_cast<int>(type));
     }
index a481f40b0a7a61f1b11c3afdb569668d625b41f7..bf5fe7b1c2b6e13738e1b21f6e45164711b93d5a 100644 (file)
@@ -117,8 +117,7 @@ SharedFlqAllocator::pickAddressInternal(const ClientClasses& client_classes,
 
             break;
         }
-        case Lease::TYPE_NA:
-        case Lease::TYPE_TA:{
+        case Lease::TYPE_NA:{
             auto free_lease = LeaseMgrFactory::instance()
                               .sflqPickFreeLease6(pool->getFirstAddress(),
                                                   pool->getLastAddress());
@@ -132,6 +131,9 @@ SharedFlqAllocator::pickAddressInternal(const ClientClasses& client_classes,
         case Lease::TYPE_PD:
             isc_throw(Unexpected, "pickAddressInternal called for Lease::TYPE_PD");
                 break;
+        default:
+            isc_throw(Unexpected, "pickAddressInternal called for unknown lease type " << pool_type_);
+            break;
         }
 
         // Remove the exhausted pool from the list then try another one.
@@ -174,13 +176,12 @@ SharedFlqAllocator::pickPrefixInternal(const ClientClasses& client_classes,
         PoolPtr const pool = available[offset];
         switch(pool_type_) {
         case Lease::TYPE_V4:
-            isc_throw(Unexpected, "pickAddressInternal called for Lease::TYPE_V4");
+            isc_throw(Unexpected, "pickPrefixInternal called for Lease::TYPE_V4");
             break;
         case Lease::TYPE_NA:
-        case Lease::TYPE_TA:
-            isc_throw(Unexpected, "pickAddressInternal called for Lease::TYPE_NA");
+            isc_throw(Unexpected, "pickPrefixInternal called for Lease::TYPE_NA");
             break;
-        case Lease::TYPE_PD:
+        case Lease::TYPE_PD:{
             // Ask the lease manager for a lease from the pool.
             auto free_lease = LeaseMgrFactory::instance()
                               .sflqPickFreeLease6(pool->getFirstAddress(),
@@ -189,7 +190,10 @@ SharedFlqAllocator::pickPrefixInternal(const ClientClasses& client_classes,
                 getSubnetState()->setLastAllocatedTime();
                 return (free_lease);
             }
-
+            }
+            break;
+        default:
+            isc_throw(Unexpected, "pickPrefixInternal called for unknown lease type " << pool_type_);
             break;
         }
 
index 249440cc3b0a52d65ae8087429c7640173bb3789..035b99d59fd409b9293a30193f28092ce0270ce5 100644 (file)
@@ -101,8 +101,6 @@ Subnet::getPoolCapacity(Lease::Type type) const {
     case Lease::TYPE_V4:
     case Lease::TYPE_NA:
         return sumPoolCapacity(pools_);
-    case Lease::TYPE_TA:
-        return sumPoolCapacity(pools_ta_);
     case Lease::TYPE_PD:
         return sumPoolCapacity(pools_pd_);
     default:
@@ -118,8 +116,6 @@ Subnet::getPoolCapacity(Lease::Type type,
     case Lease::TYPE_V4:
     case Lease::TYPE_NA:
         return sumPoolCapacity(pools_, client_classes);
-    case Lease::TYPE_TA:
-        return sumPoolCapacity(pools_ta_, client_classes);
     case Lease::TYPE_PD:
         return sumPoolCapacity(pools_pd_, client_classes);
     default:
@@ -137,8 +133,6 @@ Subnet::getPoolCapacity(Lease::Type type,
     case Lease::TYPE_V4:
     case Lease::TYPE_NA:
         return sumPoolCapacity(pools_, client_classes);
-    case Lease::TYPE_TA:
-        return sumPoolCapacity(pools_ta_, client_classes);
     case Lease::TYPE_PD:
         return sumPoolCapacity(pools_pd_, client_classes, prefix_length_match,
                                hint_prefix_length);
@@ -336,8 +330,6 @@ const PoolCollection& Subnet::getPools(Lease::Type type) const {
     case Lease::TYPE_V4:
     case Lease::TYPE_NA:
         return (pools_);
-    case Lease::TYPE_TA:
-        return (pools_ta_);
     case Lease::TYPE_PD:
         return (pools_pd_);
     default:
@@ -354,8 +346,6 @@ PoolCollection& Subnet::getPoolsWritable(Lease::Type type) {
     case Lease::TYPE_V4:
     case Lease::TYPE_NA:
         return (pools_);
-    case Lease::TYPE_TA:
-        return (pools_ta_);
     case Lease::TYPE_PD:
         return (pools_pd_);
     default:
@@ -500,8 +490,7 @@ Subnet::addPool(const PoolPtr& pool) {
     } else {
         overlaps =
             poolOverlaps(Lease::TYPE_NA, pool) ||
-            poolOverlaps(Lease::TYPE_PD, pool) ||
-            poolOverlaps(Lease::TYPE_TA, pool);
+            poolOverlaps(Lease::TYPE_PD, pool);
     }
 
     if (overlaps) {
@@ -674,10 +663,10 @@ Subnet6::create(const IOAddress& prefix, uint8_t length,
 }
 
 void Subnet6::checkType(Lease::Type type) const {
-    if ((type != Lease::TYPE_NA) && (type != Lease::TYPE_TA) && (type != Lease::TYPE_PD)) {
+    if ((type != Lease::TYPE_NA) && (type != Lease::TYPE_PD)) {
         isc_throw(BadValue, "Invalid Pool type: " << Lease::typeToText(type)
                   << "(" << static_cast<int>(type)
-                  << "), must be TYPE_NA, TYPE_TA or TYPE_PD for Subnet6");
+                  << "), must be TYPE_NA or TYPE_PD for Subnet6");
     }
 }
 
@@ -836,11 +825,7 @@ Subnet6::createAllocators() {
         setAllocator(Lease::TYPE_NA,
                      boost::make_shared<RandomAllocator>
                      (Lease::TYPE_NA, shared_from_this()));
-        setAllocator(Lease::TYPE_TA,
-                     boost::make_shared<RandomAllocator>
-                     (Lease::TYPE_TA, shared_from_this()));
         setAllocationState(Lease::TYPE_NA, SubnetAllocationStatePtr());
-        setAllocationState(Lease::TYPE_TA, SubnetAllocationStatePtr());
 
     } else if (allocator_type == "flq") {
         isc_throw(BadValue, "Free Lease Queue allocator is not supported for IPv6 address pools");
@@ -855,7 +840,6 @@ Subnet6::createAllocators() {
                      boost::make_shared<IterativeAllocator>
                      (Lease::TYPE_NA, shared_from_this()));
         setAllocationState(Lease::TYPE_NA, SubnetIterativeAllocationState::create(shared_from_this()));
-        setAllocationState(Lease::TYPE_TA, SubnetIterativeAllocationState::create(shared_from_this()));
     }
 
     auto pd_allocator_type = getPdAllocatorType();
@@ -895,14 +879,6 @@ Subnet6::createAllocators() {
             pool->setAllocationState(PoolIterativeAllocationState::create(pool));
         }
     }
-    // Create allocation states for TA pools.
-    for (auto const& pool : pools_ta_) {
-        if (allocator_type == "random") {
-            pool->setAllocationState(PoolRandomAllocationState::create(pool));
-        } else {
-            pool->setAllocationState(PoolIterativeAllocationState::create(pool));
-        }
-    }
     // Create allocation states for PD pools.
     for (auto const& pool : pools_pd_) {
         if (pd_allocator_type == "random") {
index a2874a9a3ced1450e5839aaa5315a47b517b2a07..e0acb16a1df1b212b7ed3427e38c4f4f0521b4c2 100644 (file)
@@ -423,9 +423,6 @@ protected:
     /// @brief collection of IPv4 or non-temporary IPv6 pools in that subnet.
     PoolCollection pools_;
 
-    /// @brief collection of IPv6 temporary address pools in that subnet.
-    PoolCollection pools_ta_;
-
     /// @brief collection of IPv6 prefix pools in that subnet.
     PoolCollection pools_pd_;
 
index 8e9ee033b9c102a2b8c118d715985c890ec8fcda..52c7413cc14a1f3034134e2acc4dca4a2516d2df 100644 (file)
@@ -3398,15 +3398,11 @@ TEST_F(ParseConfigTest, defaultSubnet6) {
     EXPECT_EQ("", subnet->getDdnsConflictResolutionMode().get());
 
     EXPECT_TRUE(subnet->getAllocationState(Lease::TYPE_NA));
-    EXPECT_TRUE(subnet->getAllocationState(Lease::TYPE_TA));
     EXPECT_TRUE(subnet->getAllocationState(Lease::TYPE_PD));
 
     auto allocator = subnet->getAllocator(Lease::TYPE_NA);
     EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>(allocator));
 
-    allocator = subnet->getAllocator(Lease::TYPE_TA);
-    EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>(allocator));
-
     allocator = subnet->getAllocator(Lease::TYPE_PD);
     EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>(allocator));
 
@@ -3818,9 +3814,6 @@ TEST_F(ParseConfigTest, randomSubnetAllocator6) {
     auto allocator = subnet->getAllocator(Lease::TYPE_NA);
     ASSERT_TRUE(allocator);
     EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>(allocator));
-    allocator = subnet->getAllocator(Lease::TYPE_TA);
-    ASSERT_TRUE(allocator);
-    EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>(allocator));
     // PD allocator should be iterative.
     allocator = subnet->getAllocator(Lease::TYPE_PD);
     ASSERT_TRUE(allocator);
@@ -3904,9 +3897,6 @@ TEST_F(ParseConfigTest, randomSubnetPdAllocator6) {
     auto allocator = subnet->getAllocator(Lease::TYPE_NA);
     ASSERT_TRUE(allocator);
     EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>(allocator));
-    allocator = subnet->getAllocator(Lease::TYPE_TA);
-    ASSERT_TRUE(allocator);
-    EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>(allocator));
     // PD allocator should be random.
     allocator = subnet->getAllocator(Lease::TYPE_PD);
     ASSERT_TRUE(allocator);
@@ -3941,9 +3931,6 @@ TEST_F(ParseConfigTest, flqSubnetPdAllocator6) {
     auto allocator = subnet->getAllocator(Lease::TYPE_NA);
     ASSERT_TRUE(allocator);
     EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>(allocator));
-    allocator = subnet->getAllocator(Lease::TYPE_TA);
-    ASSERT_TRUE(allocator);
-    EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>(allocator));
     // PD allocator should use FLQ.
     allocator = subnet->getAllocator(Lease::TYPE_PD);
     ASSERT_TRUE(allocator);
index 9c93bb94a4ed2cb6a7658ebb7565713095bbc4d9..b5478df1ab39b3b36da04e4117cd8c1c647c1ceb 100644 (file)
@@ -69,30 +69,24 @@ TEST(IterativeAllocationStateTest, subnetLastAllocated6) {
                                   64, 1, 2, 3, 4, SubnetID(1));
     auto state_na = boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
         (subnet->getAllocationState(Lease::TYPE_NA));
-    auto state_ta = boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
-        (subnet->getAllocationState(Lease::TYPE_TA));
     auto state_pd = boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
         (subnet->getAllocationState(Lease::TYPE_PD));
 
     // Check initial conditions (all should be set to the last address in range)
     EXPECT_EQ(last.toText(), state_na->getLastAllocated().toText());
-    EXPECT_EQ(last.toText(), state_ta->getLastAllocated().toText());
     EXPECT_EQ(last.toText(), state_pd->getLastAllocated().toText());
 
     // Now set last allocated for IA
     EXPECT_NO_THROW(state_na->setLastAllocated(na));
     EXPECT_EQ(na.toText(), state_na->getLastAllocated().toText());
 
-    // TA and PD should be unchanged
-    EXPECT_EQ(last.toText(), state_ta->getLastAllocated().toText());
+    // PD should be unchanged
     EXPECT_EQ(last.toText(), state_pd->getLastAllocated().toText());
 
-    // Now set TA and PD
-    EXPECT_NO_THROW(state_ta->setLastAllocated(ta));
+    // Now set PD
     EXPECT_NO_THROW(state_pd->setLastAllocated(pd));
 
     EXPECT_EQ(na.toText(), state_na->getLastAllocated().toText());
-    EXPECT_EQ(ta.toText(), state_ta->getLastAllocated().toText());
     EXPECT_EQ(pd.toText(), state_pd->getLastAllocated().toText());
 }
 
@@ -110,30 +104,24 @@ TEST(IterativeAllocationStateTest, subnetLastAllocated6MultiThreading) {
                                   64, 1, 2, 3, 4, SubnetID(1));
     auto state_na = boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
         (subnet->getAllocationState(Lease::TYPE_NA));
-    auto state_ta = boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
-        (subnet->getAllocationState(Lease::TYPE_TA));
     auto state_pd = boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
         (subnet->getAllocationState(Lease::TYPE_PD));
 
     // Check initial conditions (all should be set to the last address in range)
     EXPECT_EQ(last.toText(), state_na->getLastAllocated().toText());
-    EXPECT_EQ(last.toText(), state_ta->getLastAllocated().toText());
     EXPECT_EQ(last.toText(), state_pd->getLastAllocated().toText());
 
     // Now set last allocated for IA
     EXPECT_NO_THROW(state_na->setLastAllocated(na));
     EXPECT_EQ(na.toText(), state_na->getLastAllocated().toText());
 
-    // TA and PD should be unchanged
-    EXPECT_EQ(last.toText(), state_ta->getLastAllocated().toText());
+    // PD should be unchanged
     EXPECT_EQ(last.toText(), state_pd->getLastAllocated().toText());
 
-    // Now set TA and PD
-    EXPECT_NO_THROW(state_ta->setLastAllocated(ta));
+    // Now set PD
     EXPECT_NO_THROW(state_pd->setLastAllocated(pd));
 
     EXPECT_EQ(na.toText(), state_na->getLastAllocated().toText());
-    EXPECT_EQ(ta.toText(), state_ta->getLastAllocated().toText());
     EXPECT_EQ(pd.toText(), state_pd->getLastAllocated().toText());
 }
 
index 00788851a7375e85abaf46293ede419d7b29e7d0..e702ec0fb33a5d3a77259468fb4bd16145e2d4fc 100644 (file)
@@ -700,17 +700,6 @@ TEST(Lease6Test, constructorDefault) {
                                              duid, iaid, 100, 200,
                                              subnet_id, true, true, "", HWAddrPtr(), 96)),
                      BadValue, "prefixlen must be 128 for non prefix type");
-
-    addr = IOAddress(ADDRESS[4]);
-    EXPECT_THROW_MSG(lease2.reset(new Lease6(Lease::TYPE_TA, addr,
-                                             duid, iaid, 100, 200,
-                                             subnet_id, HWAddrPtr(), 96)),
-                     BadValue, "prefixlen must be 128 for non prefix type");
-
-    EXPECT_THROW_MSG(lease2.reset(new Lease6(Lease::TYPE_TA, addr,
-                                             duid, iaid, 100, 200,
-                                             subnet_id, true, true, "", HWAddrPtr(), 96)),
-                     BadValue, "prefixlen must be 128 for non prefix type");
 }
 
 // This test verifies that the Lease6 constructor which accepts FQDN data,
index 36f525ad8d4a9e67dfc37db4ad432cd578d7c646..04c6aa1c351ab6a5e59385d10711b8c27a66c744 100644 (file)
@@ -590,39 +590,6 @@ TEST(Pool6Test, PDExclude) {
                  BadValue);
 }
 
-// Checks that temporary address pools are handled properly
-TEST(Pool6Test, TA) {
-    // Note: since we defined TA pool types during PD work, we can test it
-    // now. Although the configuration to take advantage of it is not
-    // planned for now, we will support it some day.
-
-    // Let's construct 2001:db8:1::/96 temporary addresses
-    Pool6Ptr pool1;
-    EXPECT_NO_THROW(pool1.reset(new Pool6(Lease::TYPE_TA,
-                                          IOAddress("2001:db8:1::"), 96)));
-
-    // Check that TA range can be only defined for single addresses
-    EXPECT_THROW(Pool6(Lease::TYPE_TA, IOAddress("2001:db8:1::"), 96, 127),
-                 BadValue);
-
-    ASSERT_TRUE(pool1);
-    EXPECT_EQ(Lease::TYPE_TA, pool1->getType());
-    EXPECT_EQ(128, pool1->getLength()); // singular addresses, not prefixes
-    EXPECT_EQ("2001:db8:1::", pool1->getFirstAddress().toText());
-    EXPECT_EQ("2001:db8:1::ffff:ffff", pool1->getLastAddress().toText());
-
-    // Check that it's possible to have min-max range for TA
-    Pool6Ptr pool2;
-    EXPECT_NO_THROW(pool2.reset(new Pool6(Lease::TYPE_TA,
-                                          IOAddress("2001:db8:1::1"),
-                                          IOAddress("2001:db8:1::f"))));
-    ASSERT_TRUE(pool2);
-    EXPECT_EQ(Lease::TYPE_TA, pool2->getType());
-    EXPECT_EQ(128, pool2->getLength()); // singular addresses, not prefixes
-    EXPECT_EQ("2001:db8:1::1", pool2->getFirstAddress().toText());
-    EXPECT_EQ("2001:db8:1::f", pool2->getLastAddress().toText());
-}
-
 // Simple check if toText returns reasonable values
 TEST(Pool6Test, toText) {
     Pool6 pool1(Lease::TYPE_NA, IOAddress("2001:db8::1"),
index 9f5bebe1a87e6881cc8cc154c315d7dd87dab4f5..1e5a4c43998fa72e0014c64268aa34036a45db1c 100644 (file)
@@ -1205,8 +1205,6 @@ TEST(SharedNetwork6Test, getPreferredSubnet) {
     for (unsigned i = 0; i < subnets.size(); ++i) {
         preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_NA);
         EXPECT_EQ(subnets[i]->getID(), preferred->getID());
-        preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_TA);
-        EXPECT_EQ(subnets[i]->getID(), preferred->getID());
         preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_PD);
         EXPECT_EQ(subnets[i]->getID(), preferred->getID());
     }
@@ -1309,8 +1307,6 @@ TEST(SharedNetwork6Test, getPreferredSubnetMultiThreading) {
     for (unsigned i = 0; i < subnets.size(); ++i) {
         preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_NA);
         EXPECT_EQ(subnets[i]->getID(), preferred->getID());
-        preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_TA);
-        EXPECT_EQ(subnets[i]->getID(), preferred->getID());
         preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_PD);
         EXPECT_EQ(subnets[i]->getID(), preferred->getID());
     }
@@ -1775,8 +1771,6 @@ TEST(SharedNetwork6Test, sflqGetPreferredSubnet) {
     for (unsigned i = 0; i < subnets.size(); ++i) {
         preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_NA);
         EXPECT_EQ(subnets[i]->getID(), preferred->getID());
-        preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_TA);
-        EXPECT_EQ(subnets[i]->getID(), preferred->getID());
         preferred = network->getPreferredSubnet(subnets[i], Lease::TYPE_PD);
         EXPECT_EQ(subnets[i]->getID(), preferred->getID());
     }
index 1a5d875f96cfa0b93c795871c7abd3f3098591f8..3ab2728cc880d2d3c43dcae0ad2492273b0196c2 100644 (file)
@@ -700,7 +700,7 @@ TEST(Subnet4Test, PoolType) {
     PoolPtr pool1(new Pool4(IOAddress("192.2.1.0"), 24));
     PoolPtr pool2(new Pool4(IOAddress("192.2.2.0"), 24));
     PoolPtr pool3(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:1:3::"), 64));
-    PoolPtr pool4(new Pool6(Lease::TYPE_TA, IOAddress("2001:db8:1:4::"), 64));
+    PoolPtr pool4(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:1:4::"), 64));
     PoolPtr pool5(new Pool6(Lease::TYPE_PD, IOAddress("2001:db8:1:1::"), 64));
 
     // There should be no pools of any type by default
@@ -708,7 +708,6 @@ TEST(Subnet4Test, PoolType) {
 
     // It should not be possible to ask for V6 pools in Subnet4
     EXPECT_THROW(subnet->getAnyPool(Lease::TYPE_NA), BadValue);
-    EXPECT_THROW(subnet->getAnyPool(Lease::TYPE_TA), BadValue);
     EXPECT_THROW(subnet->getAnyPool(Lease::TYPE_PD), BadValue);
 
     // Let's add a single V4 pool and check that it can be retrieved
@@ -1005,7 +1004,6 @@ TEST(Subnet6Test, Pool6getCapacity) {
     PoolPtr pool3(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:1:3::"), 96));
 
     EXPECT_EQ(0, subnet->getPoolCapacity(Lease::TYPE_NA));
-    EXPECT_EQ(0, subnet->getPoolCapacity(Lease::TYPE_TA));
     EXPECT_EQ(0, subnet->getPoolCapacity(Lease::TYPE_PD));
 
     subnet->addPool(pool1);
@@ -1065,7 +1063,6 @@ TEST(Subnet6Test, Pool6PdgetPoolCapacity) {
     PoolPtr pool3(new Pool6(Lease::TYPE_PD, IOAddress("2001:db8:3::"), 48, 80));
 
     EXPECT_EQ(0, subnet->getPoolCapacity(Lease::TYPE_NA));
-    EXPECT_EQ(0, subnet->getPoolCapacity(Lease::TYPE_TA));
     EXPECT_EQ(0, subnet->getPoolCapacity(Lease::TYPE_PD));
 
     subnet->addPool(pool1);
@@ -1162,7 +1159,7 @@ TEST(Subnet6Test, poolTypes) {
                                   56, 1, 2, 3, 4, SubnetID(1));
 
     PoolPtr pool1(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:1:1::"), 64));
-    PoolPtr pool2(new Pool6(Lease::TYPE_TA, IOAddress("2001:db8:1:2::"), 64));
+    PoolPtr pool2(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:1:2::"), 64));
     PoolPtr pool3(new Pool6(Lease::TYPE_PD, IOAddress("2001:db8:1:3::"), 64));
     PoolPtr pool4(new Pool6(Lease::TYPE_PD, IOAddress("3000:1::"), 64));
 
@@ -1170,7 +1167,6 @@ TEST(Subnet6Test, poolTypes) {
 
     // There should be no pools of any type by default
     EXPECT_EQ(PoolPtr(), subnet->getAnyPool(Lease::TYPE_NA));
-    EXPECT_EQ(PoolPtr(), subnet->getAnyPool(Lease::TYPE_TA));
     EXPECT_EQ(PoolPtr(), subnet->getAnyPool(Lease::TYPE_PD));
 
     // Trying to get IPv4 pool from Subnet6 is not allowed
@@ -1184,30 +1180,27 @@ TEST(Subnet6Test, poolTypes) {
     EXPECT_EQ(pool1, subnet->getPool(Lease::TYPE_NA, IOAddress("2001:db8:1:1::1")));
 
     // Check if pools of different type are not returned
-    EXPECT_EQ(PoolPtr(), subnet->getAnyPool(Lease::TYPE_TA));
     EXPECT_EQ(PoolPtr(), subnet->getAnyPool(Lease::TYPE_PD));
 
     // We ask with good hints, but wrong types, should return nothing
     EXPECT_EQ(PoolPtr(), subnet->getPool(Lease::TYPE_PD, IOAddress("2001:db8:1:2::1")));
-    EXPECT_EQ(PoolPtr(), subnet->getPool(Lease::TYPE_TA, IOAddress("2001:db8:1:3::1")));
+    EXPECT_EQ(PoolPtr(), subnet->getPool(Lease::TYPE_PD, IOAddress("2001:db8:1:3::1")));
 
-    // Let's add TA and PD pools
+    // Let's add second NA and first PD pools
     EXPECT_NO_THROW(subnet->addPool(pool2));
     EXPECT_NO_THROW(subnet->addPool(pool3));
 
     // Try without hints
     EXPECT_EQ(pool1, subnet->getAnyPool(Lease::TYPE_NA));
-    EXPECT_EQ(pool2, subnet->getAnyPool(Lease::TYPE_TA));
     EXPECT_EQ(pool3, subnet->getAnyPool(Lease::TYPE_PD));
 
     // Try with valid hints
     EXPECT_EQ(pool1, subnet->getPool(Lease::TYPE_NA, IOAddress("2001:db8:1:1::1")));
-    EXPECT_EQ(pool2, subnet->getPool(Lease::TYPE_TA, IOAddress("2001:db8:1:2::1")));
+    EXPECT_EQ(pool2, subnet->getPool(Lease::TYPE_NA, IOAddress("2001:db8:1:2::1")));
     EXPECT_EQ(pool3, subnet->getPool(Lease::TYPE_PD, IOAddress("2001:db8:1:3::1")));
 
     // Try with bogus hints (hints should be ignored)
     EXPECT_EQ(pool1, subnet->getPool(Lease::TYPE_NA, IOAddress("2001:db8:1:7::1")));
-    EXPECT_EQ(pool2, subnet->getPool(Lease::TYPE_TA, IOAddress("2001:db8:1:7::1")));
     EXPECT_EQ(pool3, subnet->getPool(Lease::TYPE_PD, IOAddress("2001:db8:1:7::1")));
 
     // Let's add a second PD pool
@@ -1771,9 +1764,6 @@ TEST(Subnet6Test, createAllocatorsIterative) {
     // NA pool.
     auto pool = boost::make_shared<Pool6>(Lease::TYPE_NA, IOAddress("2001:db8:1:1::"), 112);
     subnet->addPool(pool);
-    // TA pool.
-    auto ta_pool = boost::make_shared<Pool6>(Lease::TYPE_TA, IOAddress("2001:db8:1:2::"), 112);
-    subnet->addPool(ta_pool);
     // PD pool.
     auto pd_pool = boost::make_shared<Pool6>(Lease::TYPE_PD, IOAddress("3000::"), 112, 120);
     subnet->addPool(pd_pool);
@@ -1782,25 +1772,16 @@ TEST(Subnet6Test, createAllocatorsIterative) {
     // Expect iterative allocator for NA.
     EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>
                 (subnet->getAllocator(Lease::TYPE_NA)));
-    // Expect iterative allocator for TA.
-    EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>
-                (subnet->getAllocator(Lease::TYPE_TA)));
     // Expect iterative allocator for PD.
     EXPECT_TRUE(boost::dynamic_pointer_cast<IterativeAllocator>
                 (subnet->getAllocator(Lease::TYPE_PD)));
     // Expect iterative allocation state for NA.
     EXPECT_TRUE(boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
                 (subnet->getAllocationState(Lease::TYPE_NA)));
-    // Expect iterative allocation state for TA.
-    EXPECT_TRUE(boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
-                (subnet->getAllocationState(Lease::TYPE_TA)));
     // Expect iterative allocation state for PD.
     EXPECT_TRUE(boost::dynamic_pointer_cast<SubnetIterativeAllocationState>
                 (subnet->getAllocationState(Lease::TYPE_PD)));
     // Expect iterative allocation state for the NA pool.
-    EXPECT_TRUE(boost::dynamic_pointer_cast<PoolIterativeAllocationState>
-                (pool->getAllocationState()));
-    // Expect iterative allocation state for the TA pool.
     EXPECT_TRUE(boost::dynamic_pointer_cast<PoolIterativeAllocationState>
                 (pool->getAllocationState()));
     // Expect iterative allocation state for the PD pool.
@@ -1818,9 +1799,6 @@ TEST(Subnet6Test, createAllocatorsRandom) {
     // NA pool.
     auto pool = boost::make_shared<Pool6>(Lease::TYPE_NA, IOAddress("2001:db8:1:1::"), 112);
     subnet->addPool(pool);
-    // TA pool.
-    auto ta_pool = boost::make_shared<Pool6>(Lease::TYPE_TA, IOAddress("2001:db8:1:2::"), 112);
-    subnet->addPool(ta_pool);
     // PD pool.
     auto pd_pool = boost::make_shared<Pool6>(Lease::TYPE_PD, IOAddress("3000::"), 112, 120);
     subnet->addPool(pd_pool);
@@ -1832,16 +1810,11 @@ TEST(Subnet6Test, createAllocatorsRandom) {
     // Expect random allocator for NA.
     EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>
                 (subnet->getAllocator(Lease::TYPE_NA)));
-    // Expect random allocator for TA.
-    EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>
-                (subnet->getAllocator(Lease::TYPE_TA)));
     // Expect random allocator for PD.
     EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>
                 (subnet->getAllocator(Lease::TYPE_PD)));
     // Expect null subnet allocation state for NA.
     EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_NA));
-    // Expect null subnet allocation state for TA.
-    EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_TA));
     // Expect null subnet allocation state for PD.
     EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_PD));
     // Expect random allocation state for the NA pool.
@@ -1865,9 +1838,6 @@ TEST(Subnet6Test, createAllocatorsFreeLeaseQueue) {
     // NA pool.
     auto pool = boost::make_shared<Pool6>(Lease::TYPE_NA, IOAddress("2001:db8:1:1::"), 112);
     subnet->addPool(pool);
-    // TA pool.
-    auto ta_pool = boost::make_shared<Pool6>(Lease::TYPE_TA, IOAddress("2001:db8:1:2::"), 112);
-    subnet->addPool(ta_pool);
     // PD pool.
     auto pd_pool = boost::make_shared<Pool6>(Lease::TYPE_PD, IOAddress("3000::"), 112, 120);
     subnet->addPool(pd_pool);
@@ -1880,28 +1850,20 @@ TEST(Subnet6Test, createAllocatorsFreeLeaseQueue) {
     // Expect random allocator for NA.
     EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>
                 (subnet->getAllocator(Lease::TYPE_NA)));
-    // Expect random allocator for TA.
-    EXPECT_TRUE(boost::dynamic_pointer_cast<RandomAllocator>
-                (subnet->getAllocator(Lease::TYPE_TA)));
     // Expect FLQ allocator for PD.
     EXPECT_TRUE(boost::dynamic_pointer_cast<FreeLeaseQueueAllocator>
                 (subnet->getAllocator(Lease::TYPE_PD)));
     // Expect null subnet allocation state for NA.
     EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_NA));
-    // Expect null subnet allocation state for TA.
-    EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_TA));
     // Expect null subnet allocation state for PD.
     EXPECT_FALSE(subnet->getAllocationState(Lease::TYPE_PD));
     // Expect random allocation state for the NA pool.
-    EXPECT_TRUE(boost::dynamic_pointer_cast<PoolRandomAllocationState>
-                (pool->getAllocationState()));
-    // Expect random allocation state for the TA pool.
     EXPECT_TRUE(boost::dynamic_pointer_cast<PoolRandomAllocationState>
                 (pool->getAllocationState()));
     // Expect FLQ allocation state for the PD pool.
     EXPECT_TRUE(boost::dynamic_pointer_cast<PoolFreeLeaseQueueAllocationState>
-                (pd_pool->getAllocationState()));
-}
+                (pd_pool->getAllocationState()));}
+
 
 // Test that it is not allowed to use the FLQ allocator for the address pools.
 TEST(Subnet6Test, createAllocatorsFreeLeaseQueueNotAllowed) {
index 6b965eafeadf363ad54f0e00000c6bf9a73d6fe7..6685e48a75f04a1da4ab53c8c7d8cd007d26d15b 100644 (file)
@@ -60,8 +60,8 @@ const char* ADDRESS6[] = {
 
 // Lease types that correspond to ADDRESS6 leases
 static const Lease::Type LEASETYPE6[] = {
-    Lease::TYPE_NA, Lease::TYPE_TA, Lease::TYPE_PD, Lease::TYPE_NA,
-    Lease::TYPE_TA, Lease::TYPE_PD, Lease::TYPE_NA, Lease::TYPE_TA
+    Lease::TYPE_NA, Lease::TYPE_PD, Lease::TYPE_NA, Lease::TYPE_PD,
+    Lease::TYPE_NA, Lease::TYPE_PD, Lease::TYPE_NA, Lease::TYPE_PD
 };
 
 GenericLeaseMgrTest::GenericLeaseMgrTest()
@@ -248,7 +248,7 @@ GenericLeaseMgrTest::initializeLease6(std::string address) {
     } else if (address == straddress6_[1]) {
         lease->hwaddr_.reset(new HWAddr(vector<uint8_t>(6, 0x19), HTYPE_ETHER));
         lease->type_ = leasetype6_[1];
-        lease->prefixlen_ = 128;
+        lease->prefixlen_ = 48;
         lease->iaid_ = 42;
         lease->duid_ = DuidPtr(new DUID(vector<uint8_t>(8, 0x42)));
         lease->preferred_lft_ = 3600;
@@ -264,7 +264,7 @@ GenericLeaseMgrTest::initializeLease6(std::string address) {
     } else if (address == straddress6_[2]) {
         lease->hwaddr_.reset(new HWAddr(vector<uint8_t>(6, 0x2a), HTYPE_ETHER));
         lease->type_ = leasetype6_[2];
-        lease->prefixlen_ = 48;
+        lease->prefixlen_ = 128;
         lease->iaid_ = 89;
         lease->duid_ = DuidPtr(new DUID(vector<uint8_t>(8, 0x3a)));
         lease->preferred_lft_ = 1800;
@@ -280,7 +280,7 @@ GenericLeaseMgrTest::initializeLease6(std::string address) {
         // Hardware address same as lease 1.
         lease->hwaddr_.reset(new HWAddr(vector<uint8_t>(6, 0x19), HTYPE_ETHER));
         lease->type_ = leasetype6_[3];
-        lease->prefixlen_ = 128;
+        lease->prefixlen_ = 48;
         lease->iaid_ = 0xfffffffe;
         vector<uint8_t> duid;
         for (uint8_t i = 31; i < 126; ++i) {
@@ -357,7 +357,7 @@ GenericLeaseMgrTest::initializeLease6(std::string address) {
         lease->hwaddr_.reset(new HWAddr(vector<uint8_t>(), HTYPE_ETHER)); // Empty
         // Same IAID as straddress6_1
         lease->type_ = leasetype6_[7];
-        lease->prefixlen_ = 128;
+        lease->prefixlen_ = 56;
         lease->iaid_ = 42;
         lease->duid_ = DuidPtr(new DUID(vector<uint8_t>(8, 0xe5)));
         lease->preferred_lft_ = 5600;
@@ -1821,8 +1821,8 @@ GenericLeaseMgrTest::testLease6LeaseTypeCheck() {
     // Make Two leases per lease type, all with the same DUID, IAID but
     // alternate the subnet_ids.
     vector<Lease6Ptr> leases;
-    for (int i = 0; i < 6; ++i) {
-        if (i > 3) {
+    for (int i = 0; i < 4; ++i) {
+        if (i > 2) {
             empty_lease->prefixlen_ = 48;
         } else {
             empty_lease->prefixlen_ = 128;
@@ -1836,7 +1836,7 @@ GenericLeaseMgrTest::testLease6LeaseTypeCheck() {
     }
 
     // Verify getting a single lease by type and address.
-    for (int i = 0; i < 6; ++i) {
+    for (int i = 0; i < 4; ++i) {
         // Look for exact match for each lease type.
         Lease6Ptr returned = lmptr_->getLease6(leasetype6_[i / 2],
                                                leases[i]->addr_);
@@ -1852,7 +1852,7 @@ GenericLeaseMgrTest::testLease6LeaseTypeCheck() {
     // Verify getting a collection of leases by type, DUID, and IAID.
     // Iterate over the lease types, asking for leases based on
     // lease type, DUID, and IAID.
-    for (size_t i = 0; i < 3; ++i) {
+    for (size_t i = 0; i < 2; ++i) {
         Lease6Collection returned = lmptr_->getLeases6(leasetype6_[i], *duid, 142);
 
         auto compare = [](const Lease6Ptr& left, const Lease6Ptr& right) {
@@ -1883,7 +1883,7 @@ GenericLeaseMgrTest::testLease6LeaseTypeCheck() {
     // Verify getting a collection of leases by type, DUID, IAID, and subnet id.
     // Iterate over the lease types, asking for leases based on
     // lease type, DUID, IAID, and subnet_id.
-    for (int i = 0; i < 3; ++i) {
+    for (int i = 0; i < 2; ++i) {
         Lease6Collection returned = lmptr_->getLeases6(leasetype6_[i], *duid, 142, 23);
         // We should match one per lease type.
         ASSERT_EQ(1, returned.size());
@@ -1891,7 +1891,7 @@ GenericLeaseMgrTest::testLease6LeaseTypeCheck() {
     }
 
     // Verify getting a single lease by type, duid, iad, and subnet id.
-    for (int i = 0; i < 6; ++i) {
+    for (int i = 0; i < 4; ++i) {
         Lease6Ptr returned = lmptr_->getLease6(leasetype6_[i / 2], *duid, 142, (23 + (i % 2)));
         // We should match one per lease type.
         ASSERT_TRUE(returned);
@@ -2178,21 +2178,21 @@ GenericLeaseMgrTest::testUpdateLease6() {
 
     // Alter the lease again and check.
     ++leases[1]->iaid_;
-    leases[1]->type_ = Lease::TYPE_TA;
+    leases[1]->type_ = Lease::TYPE_NA;
     leases[1]->cltt_ += 6;
     leases[1]->prefixlen_ = 128;
     leases[1]->setContext(Element::fromJSON("{ \"foo\": \"bar\" }"));
     lmptr_->updateLease6(leases[1]);
 
     l_returned.reset();
-    l_returned = lmptr_->getLease6(Lease::TYPE_TA, ioaddress6_[1]);
+    l_returned = lmptr_->getLease6(Lease::TYPE_NA, ioaddress6_[1]);
     ASSERT_TRUE(l_returned);
     detailCompareLease(leases[1], l_returned);
 
     // Check we can do an update without changing data.
     lmptr_->updateLease6(leases[1]);
     l_returned.reset();
-    l_returned = lmptr_->getLease6(Lease::TYPE_TA, ioaddress6_[1]);
+    l_returned = lmptr_->getLease6(Lease::TYPE_NA, ioaddress6_[1]);
     ASSERT_TRUE(l_returned);
     detailCompareLease(leases[1], l_returned);