From: Tomek Mrugalski Date: Mon, 27 Jun 2016 15:06:50 +0000 (+0200) Subject: [4109a] Minor clarifications. X-Git-Tag: trac4273_base~5^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=980154e7fceee985aeba8e202f8a8500bbec04b3;p=thirdparty%2Fkea.git [4109a] Minor clarifications. --- diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 136b8432b3..5c4ec34807 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -632,7 +632,7 @@ Dhcpv6Srv::processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp) { break; case DHCPV6_DHCPV4_QUERY: - rsp = processDhcp4Query(query); + processDhcp4Query(query); break; default: @@ -2788,7 +2788,7 @@ Dhcpv6Srv::processInfRequest(const Pkt6Ptr& inf_request) { return (reply); } -Pkt6Ptr +void Dhcpv6Srv::processDhcp4Query(const Pkt6Ptr& dhcp4_query) { sanityCheck(dhcp4_query, OPTIONAL, OPTIONAL); @@ -2804,8 +2804,8 @@ Dhcpv6Srv::processDhcp4Query(const Pkt6Ptr& dhcp4_query) { Dhcp6to4Ipc::instance().send(dhcp4_query); } - // Our job is finished - return (Pkt6Ptr()); + // This method does not return anything as we already sent back + // the response via Dhcp6To4Ipc. } void Dhcpv6Srv::classifyByVendor(const Pkt6Ptr& pkt, std::string& classes) { diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index 6521e91733..7513f909bf 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -291,11 +291,13 @@ protected: /// @brief Processes incoming DHCPv4-query message. /// + /// It always returns NULL, as there is nothing to be sent back to the + /// client at this time. The message was sent to DHCPv4 server using + /// @ref isc::dhcp::Dhcp6to4Ipc::handler()). We will send back a response + /// to the client once we get back DHCP4-REPLY from the DHCPv4 server. + /// /// @param dhcp4_query message received from client - /// @return Reply message to be sent to the client (always NULL - /// as the response will be returned after by - /// @ref isc::dhcp::Dhcp6to4Ipc::handler()). - Pkt6Ptr processDhcp4Query(const Pkt6Ptr& dhcp4_query); + void processDhcp4Query(const Pkt6Ptr& dhcp4_query); /// @brief Selects a subnet for a given client's packet. /// diff --git a/src/bin/dhcp6/dhcp6to4_ipc.cc b/src/bin/dhcp6/dhcp6to4_ipc.cc index bec0ed4b69..8bdeffcf02 100644 --- a/src/bin/dhcp6/dhcp6to4_ipc.cc +++ b/src/bin/dhcp6/dhcp6to4_ipc.cc @@ -87,6 +87,7 @@ void Dhcp6to4Ipc::handler() { // Don't use getType(): get the message type from the buffer as we // want to know if it is a relayed message (vs. internal message type). + // getType() always returns the type of internal message. uint8_t msg_type = buf[0]; if ((msg_type == DHCPV6_RELAY_FORW) || (msg_type == DHCPV6_RELAY_REPL)) { pkt->setRemotePort(DHCP6_SERVER_PORT);