BIND 10 #2596: Tie DHCP V6 server subnet to interface
BIND 10 Development
do-not-reply at isc.org
Thu Jan 17 16:16:23 UTC 2013
#2596: Tie DHCP V6 server subnet to interface
-------------------------------------+-------------------------------------
Reporter: stephen | Owner:
Type: enhancement | marcin
Priority: medium | Status:
Component: dhcp | reviewing
Keywords: | Milestone:
Sensitive: 0 | Sprint-DHCP-20130122
Sub-Project: DHCP | Resolution:
Estimated Difficulty: 0 | CVSS Scoring:
Total Hours: 0 | Defect Severity: N/A
| Feature Depending on Ticket:
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Changes (by tomek):
* owner: tomek => marcin
Comment:
Replying to [comment:4 marcin]:
> Reviewed commit d47e9e008a7eb572f370ab7b5527c8188bb24017
> '''src/bin/dhcp6/config_parser.cc'''
>
> '''createSubnet''':
> Line 1142: The const_iterator could be used instead as the value is read
only.
Done.
> Line 1164: the following condition:
> {{{
> if (iface.length()) {
> ...
> }
> }}}
> could be replaced with:
> {{{
> if (!iface.empty()) {
> ...
> }
> }}}
> as the latter is in general more efficient. Also sometimes the cppcheck
complains about the efficiency in such cases.
Done.
> Line 1165: if the interface name is specified then it is set for a
particular subnet being configured:
> {{{
> subnet_->setIface(iface);
> }}}
> The modifier function does not validate the iface. In particular a user
may be interested if the interface exists (in case he mistype it). IMO,
the configuration parser should report an error at this point if the
interface is wrong. Otherwise he is going to go through the configuration
commit successfully and then will get cryptic errors or will not get any
error at all but the server will misbehave.
Ok. Implemented validation. Also modified the test to pass on systems that
do not have eth0 interface.
> '''src/lib/dhcpsrv/subnet.h'''
> The ''iface_name'' parameter in the setIface's header has not been
documented.
It is documented now.
> getIface: should be declared const as it does modify the class members
Done.
> '''src/lib/dhcpsrv/tests/subnet_unittest.cc'''
> TEST(Subnet6Test, iface): Trivial thing but it could be probably better
to do:
> {{{
> EXPECT_TRUE(subnet.getIface().empty());
> }}}
> It looks more clear than comparison against empty string.
Done.
--
Ticket URL: <https://bind10.isc.org/ticket/2596#comment:5>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list