Commit 6a243712 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[2314] Simplified getting configured options when creating answer packet.

parent f16d079d
......@@ -340,14 +340,9 @@ void Dhcpv6Srv::appendRequestedOptions(const Pkt6Ptr& question, Pkt6Ptr& answer)
}
// Get the list of options that client requested.
const std::vector<uint16_t>& requested_opts = option_oro->getValues();
// Get the list of options configured for a subnet.
Subnet::OptionContainerPtr options = subnet->getOptionDescriptors("dhcp6");
const Subnet::OptionContainerTypeIndex& idx = options->get<1>();
// Try to match requested options with those configured for a subnet.
// If match is found, append configured option to the answer message.
BOOST_FOREACH(uint16_t opt, requested_opts) {
const Subnet::OptionContainerTypeRange& range = idx.equal_range(opt);
BOOST_FOREACH(Subnet::OptionDescriptor desc, range) {
Subnet::OptionDescriptor desc = subnet->getOptionDescriptor("dhcp6", opt);
if (desc.option) {
answer->addOption(desc.option);
}
}
......
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