diff --git a/doc/guide/dhcp6-srv.xml b/doc/guide/dhcp6-srv.xml
index 4381680468..a6b7e8a2b2 100644
--- a/doc/guide/dhcp6-srv.xml
+++ b/doc/guide/dhcp6-srv.xml
@@ -885,6 +885,9 @@ temporarily override a list of interface names and listen on all interfaces.
clt-time46uint32false
lq-relay-data47recordfalse
lq-client-link48ipv6-addresstrue
+erp-local-domain-name65fqdnfalse
+rsoo66emptyfalse
+client-linklayer-addr79binaryfalse
@@ -1371,7 +1374,7 @@ should include options from the isc option space:
Relay-Supplied Options
RFC 6422
- defines a mechanism called Relay supplied options. In certain cases relay
+ defines a mechanism called Relay-Supplied DHCP Options. In certain cases relay
agents are the only entities that may have specific information. They can
insert options when relaying messages from the client to the server. The
server will then do certain checks and copy those options to the response
@@ -1381,11 +1384,11 @@ should include options from the isc option space:
included. First, the server must not provide the option by itself. In
other words, if both relay and server provide an option, the server always
takes precedence. Second, the option must be RSOO-enabled. IANA mantains a
- list of RSOO-enabled options here: List of RSOO-enabled options.
- However, there may cases when system administrators want to echo other
+ list of RSOO-enabled options here.
+ However, there may be cases when system administrators want to echo other
options. Kea can be instructed to treat other options as RSOO-enabled.
For example, to mark options 110, 120 and 130 as RSOO-enabled, the following
- syntax may be used:
+ syntax should be used:
"Dhcp6": {
"relay-supplied-options": [ "110", "120", "130" ],
diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc
index 851863a994..bcae8d0f33 100644
--- a/src/bin/dhcp6/dhcp6_srv.cc
+++ b/src/bin/dhcp6/dhcp6_srv.cc
@@ -2739,39 +2739,28 @@ void Dhcpv6Srv::processRSOO(const Pkt6Ptr& query, const Pkt6Ptr& rsp) {
return;
}
- // Get the global options info. We'll use it to check whether an
- // option is RSOO-enabled or not.
- ConstCfgOptionPtr global_opts = CfgMgr::instance().getCurrentCfg()->
- getCfgOption();
+ // Get RSOO configuration.
+ ConstCfgRSOOPtr cfg_rsoo = CfgMgr::instance().getCurrentCfg()->getCfgRSOO();
// Let's get over all relays (encapsulation levels). We need to do
// it in the same order as the client packet traversed the relays.
for (int i = query->relay_info_.size(); i > 0 ; --i) {
OptionPtr rsoo_container = query->getRelayOption(D6O_RSOO, i - 1);
- if (!rsoo_container) {
- // No relay-supplied options by this relay? Ok, carry on.
- continue;
- }
+ if (rsoo_container) {
+ // There are RSOO options. Let's get through them one by one
+ // and if it's RSOO-enabled and there's no such option provided yet,
+ // copy it to the server's response
+ const OptionCollection& rsoo = rsoo_container->getOptions();
+ for (OptionCollection::const_iterator opt = rsoo.begin();
+ opt != rsoo.end(); ++opt) {
- // There are RSOO options. Let's get through them one by one
- // and if it's RSOO-enabled and there's no such option provided yet,
- // copy it to the server's response
- const OptionCollection& rsoo = rsoo_container->getOptions();
- for (OptionCollection::const_iterator opt = rsoo.begin(); opt != rsoo.end();
- ++opt) {
- if (!global_opts->isRSOOEnabled(opt->second->getType())) {
- // We didn't copy this option, because it's not RSOO-enabled.
- continue;
+ // Echo option if it is RSOO enabled option and there is no such
+ // option added yet.
+ if (cfg_rsoo->enabled(opt->second->getType()) &&
+ !rsp->getOption(opt->second->getType())) {
+ rsp->addOption(opt->second);
+ }
}
-
- if (rsp->getOption(opt->second->getType())) {
- // There is such an option in the server's response already,
- // we'll skip relay's option
- continue;
- }
-
- // All checks went ok, let's add this option.
- rsp->addOption(opt->second);
}
}
}
diff --git a/src/bin/dhcp6/json_config_parser.cc b/src/bin/dhcp6/json_config_parser.cc
index 53ea89b86d..f53afa1217 100644
--- a/src/bin/dhcp6/json_config_parser.cc
+++ b/src/bin/dhcp6/json_config_parser.cc
@@ -41,6 +41,7 @@
#include
#include
+#include
#include