Browse Source

[4109a] Minor clarifications.

Tomek Mrugalski 9 years ago
parent
commit
980154e7fc
3 changed files with 11 additions and 8 deletions
  1. 4 4
      src/bin/dhcp6/dhcp6_srv.cc
  2. 6 4
      src/bin/dhcp6/dhcp6_srv.h
  3. 1 0
      src/bin/dhcp6/dhcp6to4_ipc.cc

+ 4 - 4
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) {

+ 6 - 4
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.
     ///

+ 1 - 0
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);