]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1147] Checkpoint: minor revamp of client code
authorFrancis Dupont <fdupont@isc.org>
Sat, 9 May 2020 10:26:53 +0000 (12:26 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 26 May 2020 09:51:57 +0000 (11:51 +0200)
src/bin/dhcp4/client_handler.cc
src/bin/dhcp4/client_handler.h
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp6/client_handler.cc
src/bin/dhcp6/client_handler.h
src/bin/dhcp6/dhcp6_messages.cc
src/bin/dhcp6/dhcp6_messages.h

index 1275391b1bd8baa7d5fe62fd35c0114c64be50e8..8afcc1300a4813d0bc9ec2e1da064844e31ce04b 100644 (file)
@@ -24,7 +24,8 @@ ClientHandler::ClientByIdContainer ClientHandler::clients_client_id_;
 
 ClientHandler::ClientByHWAddrContainer ClientHandler::clients_hwaddr_;
 
-ClientHandler::ClientHandler() : locked_client_id_(), locked_hwaddr_() {
+ClientHandler::ClientHandler()
+    : client_(), locked_client_id_(), locked_hwaddr_() {
 }
 
 ClientHandler::~ClientHandler() {
@@ -38,6 +39,7 @@ ClientHandler::~ClientHandler() {
         unLockByHWAddr();
     }
     locked_hwaddr_.reset();
+    client_.reset();
 }
 
 ClientHandler::Client::Client(Pkt4Ptr query, DuidPtr client_id,
@@ -67,7 +69,7 @@ ClientHandler::lookup(const DuidPtr& duid) {
     if (it == clients_client_id_.end()) {
         return (0);
     }
-    return (ClientPtr(new Client(*it)));
+    return (*it);
 }
 
 ClientHandler::ClientPtr
@@ -83,25 +85,25 @@ ClientHandler::lookup(const HWAddrPtr& hwaddr) {
     if (it == clients_hwaddr_.end()) {
         return (0);
     }
-    return (ClientPtr(new Client(*it)));
+    return (*it);
 }
 
 void
-ClientHandler::lockById(Client client) {
+ClientHandler::lockById() {
     if (!locked_client_id_) {
         isc_throw(Unexpected, "nothing to lock in ClientHandler::lock (id)");
     }
     // Assume insert will never fail so not checking its result.
-    clients_client_id_.insert(client);
+    clients_client_id_.insert(client_);
 }
 
 void
-ClientHandler::lockByHWAddr(Client client) {
+ClientHandler::lockByHWAddr() {
     if (!locked_hwaddr_) {
         isc_throw(Unexpected, "nothing to lock in ClientHandler::lock (hw)");
     }
     // Assume insert will never fail so not checking its result.
-    clients_hwaddr_.insert(client);
+    clients_hwaddr_.insert(client_);
 }
 
 void
@@ -158,9 +160,8 @@ ClientHandler::tryLock(Pkt4Ptr query) {
         return (false);
     }
 
-    ClientPtr holder_id = 0;
-    ClientPtr holder_hw = 0;
-    Client client(query, duid, hwaddr);
+    ClientPtr holder_id;
+    ClientPtr holder_hw;
 
     // Try first duid.
     if (duid) {
@@ -170,7 +171,8 @@ ClientHandler::tryLock(Pkt4Ptr query) {
         holder_id = lookup(duid);
         if (!holder_id) {
             locked_client_id_ = duid;
-            lockById(client);
+            client_.reset(new Client(query, duid, hwaddr));
+            lockById();
         }
     }
     if (!holder_id) {
@@ -183,7 +185,8 @@ ClientHandler::tryLock(Pkt4Ptr query) {
         holder_hw = lookup(hwaddr);
         if (!holder_hw) {
             locked_hwaddr_ = hwaddr;
-            lockByHWAddr(client);
+            client_.reset(new Client(query, duid, hwaddr));
+            lockByHWAddr();
             return (false);
         }
     }
index 4170478b3969bb08542258a8ee030fafbbcccfa1..939a93026e8c671c00826c8532bb5bfe8b75fd21 100644 (file)
@@ -13,6 +13,7 @@
 #include <boost/multi_index/composite_key.hpp>
 #include <boost/multi_index/hashed_index.hpp>
 #include <boost/multi_index/member.hpp>
+#include <boost/shared_ptr.hpp>
 #include <mutex>
 #include <thread>
 
@@ -67,8 +68,11 @@ private:
         std::thread::id thread_;
     };
 
-    /// @brief The type of unique pointers to clients by ID.
-    typedef std::unique_ptr<Client> ClientPtr;
+    /// @brief The type of shared pointers to clients by ID.
+    typedef boost::shared_ptr<Client> ClientPtr;
+
+    /// @brief Local client.
+    ClientPtr client_;
 
     /// @brief Client ID locked by this handler.
     DuidPtr locked_client_id_;
@@ -101,16 +105,12 @@ private:
     /// @brief Acquire a client by client ID option.
     ///
     /// The by-id mutex must be held by the caller.
-    ///
-    /// @param client The filled client object.
-    void lockById(Client client);
+    void lockById();
 
     /// @brief Acquire a client by hardware address.
     ///
     /// The by-hwaddr mutex must be held by the caller.
-    ///
-    /// @param client The filled client object.
-    void lockByHWAddr(Client client);
+    void lockByHWAddr();
 
     /// @brief Release a client by client ID option.
     ///
@@ -125,8 +125,8 @@ private:
     /// @brief The type of the client-by-id container.
     typedef boost::multi_index_container<
 
-        // This container stores client-by-id objects.
-        Client,
+        // This container stores pointers to client-by-id objects.
+        ClientPtr,
 
         // Start specification of indexes here.
         boost::multi_index::indexed_by<
@@ -148,8 +148,8 @@ private:
     /// @brief The type of the client-by-hwaddr container.
     typedef boost::multi_index_container<
 
-        // This container stores client-by-hwaddr objects.
-        Client,
+        // This container stores pointers to client-by-hwaddr objects.
+        ClientPtr,
 
         // Start specification of indexes here.
         boost::multi_index::indexed_by<
index 384af6e35de1f6c10687f982beea34afb64c8ba0..c8eb93b80945bec87dc4ef2eb693339338e802d7 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Wed May 13 2020 16:50
+// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Sat May 09 2020 12:24
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -50,7 +50,6 @@ extern const isc::log::MessageID DHCP4_DECLINE_LEASE_MISMATCH = "DHCP4_DECLINE_L
 extern const isc::log::MessageID DHCP4_DECLINE_LEASE_NOT_FOUND = "DHCP4_DECLINE_LEASE_NOT_FOUND";
 extern const isc::log::MessageID DHCP4_DEFERRED_OPTION_MISSING = "DHCP4_DEFERRED_OPTION_MISSING";
 extern const isc::log::MessageID DHCP4_DEFERRED_OPTION_UNPACK_FAIL = "DHCP4_DEFERRED_OPTION_UNPACK_FAIL";
-extern const isc::log::MessageID DHCP4_DEVELOPMENT_VERSION = "DHCP4_DEVELOPMENT_VERSION";
 extern const isc::log::MessageID DHCP4_DHCP4O6_BAD_PACKET = "DHCP4_DHCP4O6_BAD_PACKET";
 extern const isc::log::MessageID DHCP4_DHCP4O6_PACKET_RECEIVED = "DHCP4_DHCP4O6_PACKET_RECEIVED";
 extern const isc::log::MessageID DHCP4_DHCP4O6_PACKET_SEND = "DHCP4_DHCP4O6_PACKET_SEND";
@@ -102,6 +101,8 @@ extern const isc::log::MessageID DHCP4_PACKET_DROP_0007 = "DHCP4_PACKET_DROP_000
 extern const isc::log::MessageID DHCP4_PACKET_DROP_0008 = "DHCP4_PACKET_DROP_0008";
 extern const isc::log::MessageID DHCP4_PACKET_DROP_0009 = "DHCP4_PACKET_DROP_0009";
 extern const isc::log::MessageID DHCP4_PACKET_DROP_0010 = "DHCP4_PACKET_DROP_0010";
+extern const isc::log::MessageID DHCP4_PACKET_DROP_0011 = "DHCP4_PACKET_DROP_0011";
+extern const isc::log::MessageID DHCP4_PACKET_DROP_0012 = "DHCP4_PACKET_DROP_0012";
 extern const isc::log::MessageID DHCP4_PACKET_NAK_0001 = "DHCP4_PACKET_NAK_0001";
 extern const isc::log::MessageID DHCP4_PACKET_NAK_0002 = "DHCP4_PACKET_NAK_0002";
 extern const isc::log::MessageID DHCP4_PACKET_NAK_0003 = "DHCP4_PACKET_NAK_0003";
@@ -197,7 +198,6 @@ const char* values[] = {
     "DHCP4_DECLINE_LEASE_NOT_FOUND", "Received DHCPDECLINE for addr %1 from client %2, but no such lease found.",
     "DHCP4_DEFERRED_OPTION_MISSING", "can find deferred option code %1 in the query",
     "DHCP4_DEFERRED_OPTION_UNPACK_FAIL", "An error unpacking the deferred option %1: %2",
-    "DHCP4_DEVELOPMENT_VERSION", "This software is a development branch of Kea. It is not recommended for production use.",
     "DHCP4_DHCP4O6_BAD_PACKET", "received malformed DHCPv4o6 packet: %1",
     "DHCP4_DHCP4O6_PACKET_RECEIVED", "received DHCPv4o6 packet from DHCPv4 server (type %1) for %2 on interface %3",
     "DHCP4_DHCP4O6_PACKET_SEND", "%1: trying to send packet %2 (type %3) to %4 port %5 on interface %6 encapsulating %7: %8 (type %9)",
@@ -249,6 +249,8 @@ const char* values[] = {
     "DHCP4_PACKET_DROP_0008", "%1: DHCP service is globally disabled",
     "DHCP4_PACKET_DROP_0009", "%1: Option 53 missing (no DHCP message type), is this a BOOTP packet?",
     "DHCP4_PACKET_DROP_0010", "dropped as member of the special class 'DROP': %1",
+    "DHCP4_PACKET_DROP_0011", "dropped as sent by the same client than a packet being processed by another thread: dropped %1 by thread %2 as duplicate of %3 processed by %4",
+    "DHCP4_PACKET_DROP_0012", "dropped as sent by the same client than a packet being processed by another thread: dropped %1 by thread %2 as duplicate of %3 processed by %4",
     "DHCP4_PACKET_NAK_0001", "%1: failed to select a subnet for incoming packet, src %2, type %3",
     "DHCP4_PACKET_NAK_0002", "%1: invalid address %2 requested by INIT-REBOOT",
     "DHCP4_PACKET_NAK_0003", "%1: failed to advertise a lease, client sent ciaddr %2, requested-ip-address %3",
@@ -286,7 +288,7 @@ const char* values[] = {
     "DHCP4_SRV_D2STOP_ERROR", "error stopping IO with DHCP_DDNS during shutdown: %1",
     "DHCP4_SRV_DHCP4O6_ERROR", "error stopping IO with DHCPv4o6 during shutdown: %1",
     "DHCP4_STARTED", "Kea DHCPv4 server version %1 started",
-    "DHCP4_STARTING", "Kea DHCPv4 server version %1 (%2) starting",
+    "DHCP4_STARTING", "Kea DHCPv4 server version %1 starting",
     "DHCP4_START_INFO", "pid: %1, server port: %2, client port: %3, verbose: %4",
     "DHCP4_SUBNET_DATA", "%1: the selected subnet details: %2",
     "DHCP4_SUBNET_DYNAMICALLY_CHANGED", "%1: changed selected subnet %2 to subnet %3 from shared network %4 for client assignments",
index 6715be1ba18576ad03a47ff457f780b32c04e4ee..35357a8930005f359eeb52f72539a1acd581f1cc 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Wed May 13 2020 16:50
+// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Sat May 09 2020 12:24
 
 #ifndef DHCP4_MESSAGES_H
 #define DHCP4_MESSAGES_H
@@ -51,7 +51,6 @@ extern const isc::log::MessageID DHCP4_DECLINE_LEASE_MISMATCH;
 extern const isc::log::MessageID DHCP4_DECLINE_LEASE_NOT_FOUND;
 extern const isc::log::MessageID DHCP4_DEFERRED_OPTION_MISSING;
 extern const isc::log::MessageID DHCP4_DEFERRED_OPTION_UNPACK_FAIL;
-extern const isc::log::MessageID DHCP4_DEVELOPMENT_VERSION;
 extern const isc::log::MessageID DHCP4_DHCP4O6_BAD_PACKET;
 extern const isc::log::MessageID DHCP4_DHCP4O6_PACKET_RECEIVED;
 extern const isc::log::MessageID DHCP4_DHCP4O6_PACKET_SEND;
@@ -103,6 +102,8 @@ extern const isc::log::MessageID DHCP4_PACKET_DROP_0007;
 extern const isc::log::MessageID DHCP4_PACKET_DROP_0008;
 extern const isc::log::MessageID DHCP4_PACKET_DROP_0009;
 extern const isc::log::MessageID DHCP4_PACKET_DROP_0010;
+extern const isc::log::MessageID DHCP4_PACKET_DROP_0011;
+extern const isc::log::MessageID DHCP4_PACKET_DROP_0012;
 extern const isc::log::MessageID DHCP4_PACKET_NAK_0001;
 extern const isc::log::MessageID DHCP4_PACKET_NAK_0002;
 extern const isc::log::MessageID DHCP4_PACKET_NAK_0003;
index 964633b242f1e507fb5d082ebef723d5721f3ba0..9cbd5782bc3fccd8c7b633d0783c4228f24ef8e0 100644 (file)
@@ -20,7 +20,7 @@ mutex ClientHandler::mutex_;
 
 ClientHandler::ClientContainer ClientHandler::clients_;
 
-ClientHandler::ClientHandler() : locked_() {
+ClientHandler::ClientHandler() : client_(), locked_() {
 }
 
 ClientHandler::~ClientHandler() {
@@ -29,6 +29,7 @@ ClientHandler::~ClientHandler() {
         unLock();
     }
     locked_.reset();
+    client_.reset();
 }
 
 ClientHandler::Client::Client(Pkt6Ptr query, DuidPtr client_id)
@@ -51,16 +52,16 @@ ClientHandler::lookup(const DuidPtr& duid) {
     if (it == clients_.end()) {
         return (0);
     }
-    return (ClientPtr(new Client(*it)));
+    return (*it);
 }
 
 void
-ClientHandler::lock(Client client) {
+ClientHandler::lock() {
     if (!locked_) {
         isc_throw(Unexpected, "nothing to lock in ClientHandler::lock");
     }
     // Assume insert will never fail so not checking its result.
-    clients_.insert(client);
+    clients_.insert(client_);
 }
 
 void
@@ -89,14 +90,15 @@ ClientHandler::tryLock(Pkt6Ptr query) {
         // A lot of code assumes this will never happen...
         isc_throw(Unexpected, "empty DUID in ClientHandler::tryLock");
     }
-    ClientPtr holder = 0;
+    ClientPtr holder;
     {
         // Try to acquire the lock and return the holder when it failed.
         lock_guard<mutex> lock_(mutex_);
         holder = lookup(duid);
         if (!holder) {
             locked_ = duid;
-            lock(Client(query, duid));
+            client_.reset(new Client(query, duid));
+            lock();
             return (false);
         }
     }
index 09e33d251a04d8117fb09a9b60fce4a78a7a87d6..cb3119652466ac709fa958326908353545487c4e 100644 (file)
@@ -12,6 +12,7 @@
 #include <boost/multi_index_container.hpp>
 #include <boost/multi_index/hashed_index.hpp>
 #include <boost/multi_index/member.hpp>
+#include <boost/shared_ptr.hpp>
 #include <mutex>
 #include <thread>
 
@@ -59,8 +60,11 @@ private:
         std::thread::id thread_;
     };
 
-    /// @brief The type of unique pointers to clients.
-    typedef std::unique_ptr<Client> ClientPtr;
+    /// @brief The type of shared pointers to clients.
+    typedef boost::shared_ptr<Client> ClientPtr;
+
+    /// @brief Local client.
+    ClientPtr client_;
 
     /// @brief Client ID locked by this handler.
     DuidPtr locked_;
@@ -79,9 +83,7 @@ private:
     /// @brief Acquire a client.
     ///
     /// The mutex must be held by the caller.
-    ///
-    /// @param client The filled client object.
-    void lock(Client client);
+    void lock();
 
     /// @brief Release a client.
     ///
@@ -91,8 +93,8 @@ private:
     /// @brief The type of the client container.
     typedef boost::multi_index_container<
 
-        // This container stores client objects.
-        Client,
+        // This container stores pointers to client objects.
+        ClientPtr,
 
         // Start specification of indexes here.
         boost::multi_index::indexed_by<
index c51147c9e92719165dad429630dfd956a9b9b2a1..18646d468379706bbba29a65f280532c8e2c66ea 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Wed May 13 2020 16:52
+// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Sat May 09 2020 12:13
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -51,7 +51,6 @@ extern const isc::log::MessageID DHCP6_DECLINE_FAIL_LEASE_WITHOUT_DUID = "DHCP6_
 extern const isc::log::MessageID DHCP6_DECLINE_FAIL_NO_LEASE = "DHCP6_DECLINE_FAIL_NO_LEASE";
 extern const isc::log::MessageID DHCP6_DECLINE_LEASE = "DHCP6_DECLINE_LEASE";
 extern const isc::log::MessageID DHCP6_DECLINE_PROCESS_IA = "DHCP6_DECLINE_PROCESS_IA";
-extern const isc::log::MessageID DHCP6_DEVELOPMENT_VERSION = "DHCP6_DEVELOPMENT_VERSION";
 extern const isc::log::MessageID DHCP6_DHCP4O6_PACKET_RECEIVED = "DHCP6_DHCP4O6_PACKET_RECEIVED";
 extern const isc::log::MessageID DHCP6_DHCP4O6_RECEIVE_FAIL = "DHCP6_DHCP4O6_RECEIVE_FAIL";
 extern const isc::log::MessageID DHCP6_DHCP4O6_RECEIVING = "DHCP6_DHCP4O6_RECEIVING";
@@ -93,6 +92,7 @@ extern const isc::log::MessageID DHCP6_OPEN_SOCKET = "DHCP6_OPEN_SOCKET";
 extern const isc::log::MessageID DHCP6_OPEN_SOCKET_FAIL = "DHCP6_OPEN_SOCKET_FAIL";
 extern const isc::log::MessageID DHCP6_PACKET_DROP_DHCP_DISABLED = "DHCP6_PACKET_DROP_DHCP_DISABLED";
 extern const isc::log::MessageID DHCP6_PACKET_DROP_DROP_CLASS = "DHCP6_PACKET_DROP_DROP_CLASS";
+extern const isc::log::MessageID DHCP6_PACKET_DROP_DUPLICATE = "DHCP6_PACKET_DROP_DUPLICATE";
 extern const isc::log::MessageID DHCP6_PACKET_DROP_PARSE_FAIL = "DHCP6_PACKET_DROP_PARSE_FAIL";
 extern const isc::log::MessageID DHCP6_PACKET_DROP_SERVERID_MISMATCH = "DHCP6_PACKET_DROP_SERVERID_MISMATCH";
 extern const isc::log::MessageID DHCP6_PACKET_DROP_UNICAST = "DHCP6_PACKET_DROP_UNICAST";
@@ -199,7 +199,6 @@ const char* values[] = {
     "DHCP6_DECLINE_FAIL_NO_LEASE", "Client %1 sent DECLINE for address %2, but there's no lease for it",
     "DHCP6_DECLINE_LEASE", "Client %1 sent DECLINE for address %2 and the server marked it as declined. The lease will be recovered in %3 seconds.",
     "DHCP6_DECLINE_PROCESS_IA", "Processing of IA (IAID: %1) from client %2 started.",
-    "DHCP6_DEVELOPMENT_VERSION", "This software is a development branch of Kea. It is not recommended for production use.",
     "DHCP6_DHCP4O6_PACKET_RECEIVED", "received DHCPv4o6 packet from DHCPv4 server (type %1) for %2 port %3 on interface %4",
     "DHCP6_DHCP4O6_RECEIVE_FAIL", "failed to receive DHCPv4o6: %1",
     "DHCP6_DHCP4O6_RECEIVING", "receiving DHCPv4o6 packet from DHCPv4 server",
@@ -241,6 +240,7 @@ const char* values[] = {
     "DHCP6_OPEN_SOCKET_FAIL", "failed to open socket: %1",
     "DHCP6_PACKET_DROP_DHCP_DISABLED", "%1: DHCP service is globally disabled",
     "DHCP6_PACKET_DROP_DROP_CLASS", "dropped as member of the special class 'DROP': %1",
+    "DHCP6_PACKET_DROP_DUPLICATE", "dropped as sent by the same client than a packet being processed by another thread: dropped %1 by thread %2 as duplicate of %3 processed by %4",
     "DHCP6_PACKET_DROP_PARSE_FAIL", "failed to parse packet from %1 to %2, received over interface %3, reason: %4",
     "DHCP6_PACKET_DROP_SERVERID_MISMATCH", "%1: dropping packet with server identifier: %2, server is using: %3",
     "DHCP6_PACKET_DROP_UNICAST", "%1: dropping unicast %2 packet as this packet should be sent to multicast",
@@ -288,7 +288,7 @@ const char* values[] = {
     "DHCP6_SRV_D2STOP_ERROR", "error stopping IO with DHCP_DDNS during shutdown: %1",
     "DHCP6_STANDALONE", "skipping message queue, running standalone",
     "DHCP6_STARTED", "Kea DHCPv6 server version %1 started",
-    "DHCP6_STARTING", "Kea DHCPv6 server version %1 (%2) starting",
+    "DHCP6_STARTING", "Kea DHCPv6 server version %1 starting",
     "DHCP6_START_INFO", "pid: %1, server port: %2, client port: %3, verbose: %4",
     "DHCP6_SUBNET_DATA", "%1: the selected subnet details: %2",
     "DHCP6_SUBNET_DYNAMICALLY_CHANGED", "%1: changed selected subnet %2 to subnet %3 from shared network %4 for client assignments",
index cc1b6751894cec164180d479d09dd6be53216dc2..1fb44f9cf8024d6f0699e17f67bf48c7f0d6012b 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Wed May 13 2020 16:52
+// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Sat May 09 2020 12:13
 
 #ifndef DHCP6_MESSAGES_H
 #define DHCP6_MESSAGES_H
@@ -52,7 +52,6 @@ extern const isc::log::MessageID DHCP6_DECLINE_FAIL_LEASE_WITHOUT_DUID;
 extern const isc::log::MessageID DHCP6_DECLINE_FAIL_NO_LEASE;
 extern const isc::log::MessageID DHCP6_DECLINE_LEASE;
 extern const isc::log::MessageID DHCP6_DECLINE_PROCESS_IA;
-extern const isc::log::MessageID DHCP6_DEVELOPMENT_VERSION;
 extern const isc::log::MessageID DHCP6_DHCP4O6_PACKET_RECEIVED;
 extern const isc::log::MessageID DHCP6_DHCP4O6_RECEIVE_FAIL;
 extern const isc::log::MessageID DHCP6_DHCP4O6_RECEIVING;
@@ -94,6 +93,7 @@ extern const isc::log::MessageID DHCP6_OPEN_SOCKET;
 extern const isc::log::MessageID DHCP6_OPEN_SOCKET_FAIL;
 extern const isc::log::MessageID DHCP6_PACKET_DROP_DHCP_DISABLED;
 extern const isc::log::MessageID DHCP6_PACKET_DROP_DROP_CLASS;
+extern const isc::log::MessageID DHCP6_PACKET_DROP_DUPLICATE;
 extern const isc::log::MessageID DHCP6_PACKET_DROP_PARSE_FAIL;
 extern const isc::log::MessageID DHCP6_PACKET_DROP_SERVERID_MISMATCH;
 extern const isc::log::MessageID DHCP6_PACKET_DROP_UNICAST;