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

[3689] Changed AllocEngine::allocateLeases6 to not reset context hostname

src/lib/dhcpsrv/alloc_engine.cc
    AllocEngine::allocateLeases6() - now only sets context host name
    if findReservation() is called.  This was stomping on the value
    already in the context.
parent 7996ff0d
......@@ -349,16 +349,20 @@ AllocEngine::allocateLeases6(ClientContext6& ctx, bool find_reservation) {
isc_throw(InvalidOperation, "DUID is mandatory for IPv6 lease allocation");
}
/// @todo This is ONLY used for unit tests and really should be taken out
/// Currently production code passes in find_reservation as false
if (find_reservation) {
std::cout << "***** TKM findReservation being called from allocateLeases6"
<< std::endl;
findReservation(ctx);
}
// Let's check whether there's a hostname specified in the reservation
if (ctx.host_) {
std::string hostname = ctx.host_->getHostname();
// If there is, let's use it
if (!hostname.empty()) {
ctx.hostname_ = hostname;
// Let's check whether there's a hostname specified in the reservation
if (ctx.host_) {
std::string hostname = ctx.host_->getHostname();
// If there is, let's use it
if (!hostname.empty()) {
ctx.hostname_ = hostname;
}
}
}
......
Supports Markdown
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