BIND 10 #2414: Use AllocationEngine to actually handle v6 clients' messages

BIND 10 Development do-not-reply at isc.org
Fri Nov 9 16:23:26 UTC 2012


#2414: Use AllocationEngine to actually handle v6 clients' messages
-------------------------------------+-------------------------------------
                   Reporter:  tomek  |                 Owner:  stephen
                       Type:  task   |                Status:  reviewing
                   Priority:         |             Milestone:  Sprint-
  medium                             |  DHCP-20121115
                  Component:  dhcp6  |            Resolution:
                   Keywords:         |             Sensitive:  0
            Defect Severity:  N/A    |           Sub-Project:  DHCP
Feature Depending on Ticket:         |  Estimated Difficulty:  0
        Add Hours to Ticket:  0      |           Total Hours:  0
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by marcin):

 * owner:  marcin => stephen


Comment:

 Replying to [comment:11 stephen]:
 > '''dhcp6_srv.cc'''[[BR]]
 > > Dhcp6Srv: Is there any reason for not initializing the Allocation
 Engine in the constructor's initialization list but in the constructor's
 body?
 > Comments in the header file indicate that it should be a pointer with
 the intention that it can be changed at runtime.  I've interpreted this to
 mean that at some point, a function call will be needed to extract
 allocation engine  parameters, something that will have to be done in the
 constructor body.  For that reason, I left the initialization there,
 rather than move it to the initialization list.
 >

 That's fair enough. I think that comment would be useful but I leave it up
 to you.

 > '''dhcp_srv_unittest.cc'''[[BR]]
 > > Dhcp6SrvTest constructor: Technically the subnet_ and pool_ could be
 initialized with constructor's initialization list not in the body.
 > Agreed, although as the initialization statements are a bit long, I
 think it would look a bit clumsy. I suggest we leave it for now.
 >

 Let's play the game, find 2 differences in the code sections below:
 {{{
     Dhcpv6SrvTest()
         : rcode_(-1),
           subnet_(new Subnet6(IOAddress("2001:db8:1::"), 48, 1000,
                               2000, 3000, 4000)),
           pool_(new Pool6(Pool6::TYPE_IA, IOAddress("2001:db8:1:1::"),
 64)) {

         subnet_->addPool6(pool_);

         CfgMgr::instance().addSubnet6(subnet_);
     }
 }}}

 vs

 {{{
     Dhcpv6SrvTest() : rcode_(-1) {
         subnet_ = Subnet6Ptr(new Subnet6(IOAddress("2001:db8:1::"), 48,
 1000,
                                          2000, 3000, 4000));
         pool_ = Pool6Ptr(new Pool6(Pool6::TYPE_IA,
 IOAddress("2001:db8:1:1::"), 64));
         subnet_->addPool6(pool_);

         CfgMgr::instance().addSubnet6(subnet_);
     }
 }}}

 Seriously speaking, I don't think it makes the constructor !''clumsy!''.
 They look pretty similar.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2414#comment:12>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list