2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[3977] Do not generate NCRs for prefix delegation.

This commit is contained in:
Marcin Siodelski
2015-10-21 12:47:04 +02:00
parent fd3e11d169
commit 52f812a86d
3 changed files with 20 additions and 1 deletions

View File

@@ -101,7 +101,7 @@ void queueNCR(const NameChangeType& chg_type, const Lease4Ptr& lease) {
void queueNCR(const NameChangeType& chg_type, const Lease6Ptr& lease) {
// DUID is required to generate NCR.
if (lease && lease->duid_) {
if (lease && (lease->type_ != Lease::TYPE_PD) && lease->duid_) {
queueNCRCommon(chg_type, lease, *(lease->duid_),
Pkt6::makeLabel(lease->duid_, lease->hwaddr_));
}

View File

@@ -40,6 +40,9 @@ void queueNCR(const dhcp_ddns::NameChangeType& chg_type, const Lease4Ptr& lease)
/// in the DHCPv6 lease. The DUID is used to compute the DHCID for the name
/// change request.
///
/// This function will skip sending the NCR if the lease type is a delegated
/// prefix.
///
/// This function is exception safe. On failure, it logs an error.
///
/// @param chg_type Type of the name change request

View File

@@ -348,6 +348,22 @@ TEST_F(NCRGenerator6Test, wrongHostname) {
}
}
// Test that NameChangeRequest is not generated if the lease is not an
// address lease, i.e. is a prefix.
TEST_F(NCRGenerator6Test, wrongLeaseType) {
// Change lease type to delegated prefix.
lease_->type_ = Lease::TYPE_PD;
{
SCOPED_TRACE("case CHG_REMOVE");
testNoUpdate(CHG_REMOVE, true, true, "myhost.example.org.");
}
{
SCOPED_TRACE("case CHG_ADD");
testNoUpdate(CHG_ADD, true, true, "myhost.example.org.");
}
}
/// @brief Test fixture class implementation for DHCPv4.
class NCRGenerator4Test : public NCRGeneratorTest<Lease4Ptr> {
public: