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

index 7707044e947bb7fedd4b33384d07797b6a5a5af2..224605f41fa53bc758abf306ddddfe29a1c8e0e7 100644 (file)
@@ -247,6 +247,11 @@ the message has been received.
 The DHCPv4 server has received a packet that it is unable to
 interpret. The reason why the packet is invalid is included in the message.
 
+% 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_PROCESS_FAIL failed to process packet received from %1: %2
 This is a general catch-all message indicating that the processing of a
 received packet failed.  The reason is given in the message.  The server
index 914e46ed13833c08c65e82601123804b00c2a204..642567d28bdcf11367a3c24ce4480b5e8d36dda8 100644 (file)
@@ -306,6 +306,8 @@ Dhcpv4Srv::run() {
         Pkt4Ptr query;
         Pkt4Ptr rsp;
 
+        try {
+
         try {
             // The lease database backend may install some timers for which
             // the handlers need to be executed periodically. Retrieve the
@@ -588,6 +590,19 @@ Dhcpv4Srv::run() {
             LOG_ERROR(dhcp4_logger, DHCP4_PACKET_SEND_FAIL)
                 .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(dhcp4_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(dhcp4_logger, DHCP4_PACKET_PROCESS_EXCEPTION)
+                .arg("an unknown exception not derived from std::exception");
+        }
     }
 
     return (true);