mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 14:35:29 +00:00
[3747] Update configuration parsers to support ignore-client-id.
This commit is contained in:
@@ -194,6 +194,8 @@ protected:
|
||||
parser = new RelayInfoParser(config_id, relay_info_, Option::V4);
|
||||
} else if (config_id.compare("option-data") == 0) {
|
||||
parser = new OptionDataListParser(config_id, options_, AF_INET);
|
||||
} else if (config_id.compare("ignore-client-id") == 0) {
|
||||
parser = new BooleanParser(config_id, boolean_values_);
|
||||
} else {
|
||||
isc_throw(NotImplemented, "unsupported parameter: " << config_id);
|
||||
}
|
||||
@@ -250,7 +252,28 @@ protected:
|
||||
Subnet4Ptr subnet4(new Subnet4(addr, len, t1, t2, valid, subnet_id));
|
||||
subnet_ = subnet4;
|
||||
|
||||
// Try global value first
|
||||
// ignore-client-id
|
||||
isc::util::OptionalValue<bool> ignore_client_id;
|
||||
try {
|
||||
ignore_client_id = boolean_values_->getParam("ignore-client-id");
|
||||
|
||||
} catch (...) {
|
||||
// Ignore because this parameter is optional and it may be specified
|
||||
// in the global scope.
|
||||
}
|
||||
|
||||
// If the ignore-client-id wasn't specified as a subnet specific parameter
|
||||
// check if there is global value specified.
|
||||
if (!ignore_client_id.isSpecified()) {
|
||||
// If not specified, use false.
|
||||
ignore_client_id.specify(globalContext()->boolean_values_->
|
||||
getOptionalParam("ignore-client-id", false));
|
||||
}
|
||||
|
||||
// Set the ignore-client-id value for the subnet.
|
||||
subnet4->setIgnoreClientId(ignore_client_id.get());
|
||||
|
||||
// next-server
|
||||
try {
|
||||
string next_server = globalContext()->string_values_->getParam("next-server");
|
||||
if (!next_server.empty()) {
|
||||
@@ -374,6 +397,8 @@ namespace dhcp {
|
||||
parser = new BooleanParser(config_id, globalContext()->boolean_values_);
|
||||
} else if (config_id.compare("dhcp-ddns") == 0) {
|
||||
parser = new D2ClientConfigParser(config_id);
|
||||
} else if (config_id.compare("ignore-client-id") == 0) {
|
||||
parser = new BooleanParser(config_id, globalContext()->boolean_values_);
|
||||
} else {
|
||||
isc_throw(DhcpConfigError,
|
||||
"unsupported global configuration parameter: "
|
||||
|
Reference in New Issue
Block a user