BIND 10 #3358: Default dhcp-ddns config does not have all elements
BIND 10 Development
do-not-reply at isc.org
Fri Mar 7 18:10:40 UTC 2014
#3358: Default dhcp-ddns config does not have all elements
-------------------------------------+-------------------------------------
Reporter: tmark | Owner:
Type: defect | UnAssigned
Priority: high | Status:
Component: dhcp-ddns | reviewing
Keywords: | Milestone: DHCP-
Sensitive: 0 | Kea0.9
Sub-Project: DHCP | Resolution:
Estimated Difficulty: 8 | CVSS Scoring:
Total Hours: 0 | Defect Severity: N/A
| Feature Depending on Ticket:
| Add Hours to Ticket: 8
| Internal?: 0
-------------------------------------+-------------------------------------
Changes (by tmark):
* hours: 0 => 8
* owner: => UnAssigned
* status: new => reviewing
Comment:
The PROBLEM:
Upon initial creation of a Kea component (i.e. b10-dhcp4 or b10-dhcp6),
the
call to getFullConfig() within the configuration handler would return the
"dhcp-ddns" portion of server's configuration populated with all of its
items' default values. This is the expected behavior.
If a dhcp-ddns item value was changed (via bindctl), such as "server-port"
or
"enable-updates", this method was correctly returning "dhcp-ddns" with
all of
the default values MERGED with the changed value(s). This is also the
desired
behavior.
Once the server is restarted, however, the "dhcp-ddns" element is returned
containing only the changed values. This causes parsing to fall over with
missing values that should have been supplied via item defaults.
The underlying problem is in config::ConfigData::getFullConfig(). This
method
was doing a flat replacement of top level maps with their configured
values,
not a merge of both default and configured values.
The SOLUTION:
What was done to address the problem was to modify
ConfigData::getFullConfig
to call a new method, getFullValue(), to properly populate top level map
items with a merge of default and configured values.
When defining maps in spec files, each item can be given a default OR
specified as part of the map's default value. The getFullValue() method
use
only one of these two sources. If the map default value is not empty
(i.e. not "{}"), then it will use the values specified here. Otherwise,
it
use the default value specified per map item:
Note that a maps within maps, will not not work correctly without further
modifications to make getFullValue recursive.
ChangeLog recommendation:
{{{
7xx. [bug] tmark
Configuration session mechanisms now return top level map items as a
merge of their default values with any values that have been changed.
This corrects a bug in which the DHCP servers (b10-dhcp4 and
b10-dhpc6)
would fail configuration parsing during start-up after one or more
of the values in their "dhcp-ddns" configuration section were
changed via bindctl.
(Trac #3358, git TBD)
}}}
--
Ticket URL: <https://bind10.isc.org/ticket/3358#comment:1>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list