BIND 10 #2596: Tie DHCP V6 server subnet to interface

BIND 10 Development do-not-reply at isc.org
Wed Jan 16 18:01:32 UTC 2013


#2596: Tie DHCP V6 server subnet to interface
-------------------------------------+-------------------------------------
            Reporter:  stephen       |                        Owner:  tomek
                Type:  enhancement   |                       Status:
            Priority:  medium        |  reviewing
           Component:  dhcp          |                    Milestone:
            Keywords:                |  Sprint-DHCP-20130122
           Sensitive:  0             |                   Resolution:
         Sub-Project:  DHCP          |                 CVSS Scoring:
Estimated Difficulty:  0             |              Defect Severity:  N/A
         Total Hours:  0             |  Feature Depending on Ticket:
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
Changes (by marcin):

 * owner:  marcin => tomek


Comment:

 Reviewed commit d47e9e008a7eb572f370ab7b5527c8188bb24017

 !ChangeLog looks ok.

 '''src/bin/dhcp6/config_parser.cc'''

 '''createSubnet''':

 Line 1142: The const_iterator could be used instead as the value is read
 only.

 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.

 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.

 '''src/lib/dhcpsrv/subnet.h'''
 The ''iface_name'' parameter in the setIface's header has not been
 documented.

 getIface: should be declared const as it does modify the class members

 '''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.

-- 
Ticket URL: <https://bind10.isc.org/ticket/2596#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list