Commit cafa3d5c authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[master] D2 correctly sets TSIG rdata original ID

    Merge branch 'trac5071'
parents bcf2ef34 1bf9e53d
......@@ -9,10 +9,12 @@
#include <d2/d2_log.h>
#include <d2/nc_trans.h>
#include <dns/rdata.h>
#include <util/random/qid_gen.h>
#include <sstream>
using namespace isc::util;
using namespace isc::util::random;
namespace isc {
namespace d2 {
......@@ -321,6 +323,8 @@ NameChangeTransaction::prepNewRequest(DdnsDomainPtr domain) {
// Create a "blank" update request.
D2UpdateMessagePtr request(new D2UpdateMessage(D2UpdateMessage::
OUTBOUND));
// Set the query id
request->setId(QidGenerator::getInstance().generateQid());
// Construct the Zone Section.
dns::Name zone_name(domain->getName());
request->setZone(zone_name, dns::RRClass::IN());
......
// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -1195,6 +1195,15 @@ TEST_F(NameChangeTransactionTest, prepNewRequest) {
// valid input.
ASSERT_NO_THROW(request = name_change->prepNewRequest(forward_domain_));
checkZone(request, forward_domain_->getName());
// The query id is random so 0 is not impossible
for (unsigned i = 0; i < 10; ++i) {
if (request->getId() == 0) {
request = name_change->prepNewRequest(forward_domain_);
}
}
EXPECT_NE(0, request->getId());
}
/// @brief Tests the addLeaseAddressRData method
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment