.arg(subnet_id)
.arg(hwaddr ? hwaddr->toText() : "(no-hwaddr)")
.arg(duid ? duid->toText() : "(duid)");
- host = alternate_source_->get4(subnet_id, hwaddr, duid);
+ if (duid) {
+ host = alternate_source_->get4(subnet_id, HWAddrPtr(), duid);
+ }
+ if (!host && hwaddr) {
+ host = alternate_source_->get4(subnet_id, hwaddr, DuidPtr());
+ }
}
return (host);
}
.arg(subnet_id)
.arg(duid ? duid->toText() : "(duid)")
.arg(hwaddr ? hwaddr->toText() : "(no-hwaddr)");
- host = alternate_source_->get6(subnet_id, duid, hwaddr);
+ if (duid) {
+ host = alternate_source_->get6(subnet_id, duid, HWAddrPtr());
+ }
+ if (!host && hwaddr) {
+ host = alternate_source_->get6(subnet_id, DuidPtr(), hwaddr);
+ }
}
return (host);
}
inbind[0].buffer = reinterpret_cast<char*>(&subnet_buffer);
inbind[0].is_unsigned = MLM_TRUE;
- /// @todo: Rethink the logic in BaseHostDataSource::get4(subnet, hwaddr, duid)
+ /// @todo: Rethink the logic in BaseHostDataSource::get6(subnet, hwaddr, duid)
if (hwaddr && duid) {
isc_throw(BadValue, "MySQL host data source get6() called with both"
" hwaddr and duid, only one of them is allowed");
duid_ = DuidPtr(new DUID(std::vector<uint8_t>(8, 0x42)));
iaid_ = 42;
+ // Create fresh instance of the HostMgr, and drop any previous HostMgr state.
+ HostMgr::instance().create();
+
// Let's use odd hardware type to check if there is no Ethernet
// hardcoded anywhere.
const uint8_t mac[] = { 0, 1, 22, 33, 44, 55};