]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4109] Ported changes from fd4o6
authorFrancis Dupont <fdupont@isc.org>
Sat, 31 Oct 2015 10:04:52 +0000 (11:04 +0100)
committerFrancis Dupont <fdupont@isc.org>
Sat, 31 Oct 2015 10:04:52 +0000 (11:04 +0100)
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/dhcp6_srv.h

index 2f0687b60f27da5da7b766e489308a5981862c66..8b5554d3a387839c1711aa17c821593d985f5af1 100644 (file)
@@ -555,6 +555,10 @@ bool Dhcpv6Srv::run() {
                 rsp = processInfRequest(query);
                 break;
 
+            case DHCPV6_DHCPV4_QUERY:
+                rsp = processDhcp4Query(query);
+                break;
+
             default:
                 // We received a packet type that we do not recognize.
                 LOG_DEBUG(bad_packet6_logger, DBG_DHCP6_BASIC, DHCP6_UNKNOWN_MSG_RECEIVED)
@@ -2789,6 +2793,26 @@ Dhcpv6Srv::processInfRequest(const Pkt6Ptr& inf_request) {
     return (reply);
 }
 
+Pkt6Ptr
+Dhcpv6Srv::processDhcp4Query(const Pkt6Ptr& dhcp4_query) {
+
+    sanityCheck(dhcp4_query, OPTIONAL, OPTIONAL);
+
+    // flags are in transid
+    // uint32_t flags = dhcp4_query->getTransid();
+    // do nothing with DHCPV4_QUERY_FLAGS_UNICAST
+
+    // Get the DHCPv4 message option
+    OptionPtr dhcp4_msg = dhcp4_query->getOption(D6O_DHCPV4_MSG);
+    if (dhcp4_msg) {
+        // Forward the whole message to the DHCPv4 server via IPC
+        Dhcp4o6Ipc::instance().send(dhcp4_query);
+    }
+
+    // Our job is finished
+    return (Pkt6Ptr());
+}
+
 size_t
 Dhcpv6Srv::unpackOptions(const OptionBuffer& buf,
                          const std::string& option_space,
index 1609af068c257164c9790a691b8d447cc616cee1..e5fc32d0783baef70a5445537a847afdaa78c5a5 100644 (file)
@@ -282,6 +282,12 @@ protected:
     /// @return Reply message to be sent to the client.
     Pkt6Ptr processInfRequest(const Pkt6Ptr& inf_request);
 
+    /// @brief Processes incoming DHCPv4-query message.
+    ///
+    /// @param dhcp4_query message received from client
+    /// @return Reply (empty) message to (not) be sent to the client.
+    Pkt6Ptr processDhcp4Query(const Pkt6Ptr& dhcp4_query);
+
     /// @brief Selects a subnet for a given client's packet.
     ///
     /// @param question client's message