From: Tomek Mrugalski Date: Tue, 11 Oct 2011 14:43:30 +0000 (+0200) Subject: [1186] Part 2 of review changes X-Git-Tag: perftcpdns_before_epoll~86^2~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=223b19a30e4897c7281bb40c9f366a01c8f449ca;p=thirdparty%2Fkea.git [1186] Part 2 of review changes - Dhcpv6Srv::process*() methods does not use references anymore - Dhcpv6Srv::shutdown variable added for ordered shutdown procedure - Dhcpv6Srv is now in isc::dhcp namespace - Dhcpv6Srv is now derived from boot/noncopyable - IfaceMgr methods and fields are now commented appropriately - IfaceMgr - Dhcpv6Srv friend declaration removed - Dhcpv6SrvTest now uses derived class to access protected methods - Dhcpv6SrvTest Solicit_Basic test now includes client-id, checks for received client-id, server-id and content of ia - IfaceMgrTest minor improvements See comments in #1186 ticket for extensive list of smaller changes and reasons behind them. --- diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 05e3c77dba..ad77621100 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -35,6 +35,8 @@ Dhcpv6Srv::Dhcpv6Srv() { /// @todo: instantiate LeaseMgr here once it is imlpemented. setServerID(); + + shutdown = false; } Dhcpv6Srv::~Dhcpv6Srv() { @@ -43,7 +45,7 @@ Dhcpv6Srv::~Dhcpv6Srv() { bool Dhcpv6Srv::run() { - while (true) { + while (!shutdown) { boost::shared_ptr query; // client's message boost::shared_ptr rsp; // server's response @@ -132,12 +134,14 @@ Dhcpv6Srv::setServerID() { } boost::shared_ptr -Dhcpv6Srv::processSolicit(boost::shared_ptr& solicit) { +Dhcpv6Srv::processSolicit(boost::shared_ptr solicit) { boost::shared_ptr reply(new Pkt6(DHCPV6_ADVERTISE, solicit->getTransid(), Pkt6::UDP)); + /// TODO Rewrite this once LeaseManager is implemented. + // answer client's IA (this is mostly a dummy, // so let's answer only first IA and hope there is only one) boost::shared_ptr