]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4206] Fix for empty client-id in v4
authorTomek Mrugalski <tomasz@isc.org>
Mon, 7 Dec 2015 16:48:47 +0000 (17:48 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 7 Dec 2015 16:48:47 +0000 (17:48 +0100)
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.cc

index 17a3e6b66e7859ba379fde5e220a3576c2530a5f..826bb8715ec6f447152cb2ded68f8a0d6c5c9806 100644 (file)
@@ -457,6 +457,11 @@ This error message is issued when preparing an on-wire format of the packet
 has failed. The first argument identifies the client and the DHCP transaction.
 The second argument includes the error string.
 
+% DHCP4_PACKET_PROCESS_EXCEPTION exception occurred during packet processing: %1
+This error message indicates that an exception was raised during packet processing
+that was not caught by other, more specific exception handlers. This packet will
+be dropped and the server will continue operation.
+
 % DHCP4_PACKET_RECEIVED %1: %2 (type %3) received from %4 to %5 on interface %6
 A debug message noting that the server has received the specified type of
 packet on the specified interface. The first argument specifies the
index e3efd7eececd7f10383357bfed504383066b1c05..68ae0e50dded3549f6a3d552a3ffacf729b0a762 100644 (file)
@@ -427,6 +427,8 @@ Dhcpv4Srv::run() {
         Pkt4Ptr query;
         Pkt4Ptr rsp;
 
+        try {
+
         try {
             uint32_t timeout = 1000;
             LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_WAIT).arg(timeout);
@@ -787,6 +789,19 @@ Dhcpv4Srv::run() {
                 .arg(rsp->getLabel())
                 .arg(e.what());
         }
+
+        } catch (const std::exception& e) {
+            // General catch-all exception that are not caught by more specific
+            // catches. This one is for exceptions derived from std::exception.
+            LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_EXCEPTION)
+                .arg(e.what());
+        } catch (...) {
+            // General catch-all exception that are not caught by more specific
+            // catches. This one is for other exceptions, not derived from
+            // std::exception.
+            LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_EXCEPTION)
+                .arg("an unknown exception not derived from std::exception");
+        }
     }
 
     return (true);