Commit e720266d authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3573] Assign host specific options by the DHCPv6 server.

Also, fixes in the host unit tests.
parent 2ebc4da9
......@@ -794,7 +794,12 @@ void
Dhcpv6Srv::buildCfgOptionList(const Pkt6Ptr& question,
AllocEngine::ClientContext6& ctx,
CfgOptionList& co_list) {
// First subnet configured options
// Firstly, host specific options.
if (ctx.host_ && !ctx.host_->getCfgOption6()->empty()) {
co_list.push_back(ctx.host_->getCfgOption6());
}
// Next, subnet configured options.
if (ctx.subnet_ && !ctx.subnet_->getCfgOption()->empty()) {
co_list.push_back(ctx.subnet_->getCfgOption());
}
......
......@@ -139,7 +139,7 @@ const char* CONFIGS[] = {
"\"renew-timer\": 1000, "
"\"option-data\": [ {"
" \"name\": \"nisp-servers\","
" \"data\": \"3001:3::123\""
" \"data\": \"3000:3::123\""
"} ],"
"\"subnet6\": [ "
" { "
......@@ -148,15 +148,15 @@ const char* CONFIGS[] = {
" \"interface\" : \"eth0\","
" \"option-data\": [ {"
" \"name\": \"dns-servers\","
" \"data\": \"3001:2::123\""
" \"data\": \"3000:2::123\""
" },"
" {"
" \"name\": \"nis-servers\","
" \"data\": \"3001:2::123\""
" \"data\": \"3000:2::123\""
" },"
" {"
" \"name\": \"sntp-servers\","
" \"data\": \"3001:2::123\""
" \"data\": \"3000:2::123\""
" } ],"
" \"reservations\": ["
" {"
......@@ -164,11 +164,11 @@ const char* CONFIGS[] = {
" \"ip-addresses\": [ \"2001:db8:1::2\" ],"
" \"option-data\": [ {"
" \"name\": \"dns-servers\","
" \"data\": \"3001:1::234\""
" \"data\": \"3000:1::234\""
" },"
" {"
" \"name\": \"nis-servers\","
" \"data\": \"3001:1::234\""
" \"data\": \"3000:1::234\""
" } ]"
" } ]"
" } ]"
......@@ -195,11 +195,11 @@ const char* CONFIGS[] = {
" \"ip-addresses\": [ \"2001:db8:1::2\" ],"
" \"option-data\": [ {"
" \"name\": \"dns-servers\","
" \"data\": \"3001:1::234\""
" \"data\": \"3000:1::234\""
" },"
" {"
" \"name\": \"nis-servers\","
" \"data\": \"3001:1::234\""
" \"data\": \"3000:1::234\""
" } ]"
" } ]"
" } ]"
......@@ -222,7 +222,7 @@ const char* CONFIGS[] = {
"{"
" \"name\": \"tftp-servers\","
" \"space\": \"vendor-4491\","
" \"data\": \"3001:3::123\""
" \"data\": \"3000:3::123\""
"} ],"
"\"subnet6\": [ "
" { "
......@@ -240,7 +240,7 @@ const char* CONFIGS[] = {
" {"
" \"name\": \"tftp-servers\","
" \"space\": \"vendor-4491\","
" \"data\": \"3001:1::234\""
" \"data\": \"3000:1::234\""
" } ]"
" } ]"
" } ]"
......@@ -490,7 +490,7 @@ HostTest::testOverrideVendorOptions(const uint16_t msg_type) {
// Address specified in the host scope should be used.
Option6AddrLst::AddressContainer addrs = tftp->getAddresses();
ASSERT_EQ(addrs.size(), 1);
EXPECT_EQ("3001:1::234", addrs[0].toText());
EXPECT_EQ("3000:1::234", addrs[0].toText());
}
// Test basic SARR scenarios against a server configured with one subnet
......
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