]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4206_0.9.1] Safety checks added for DHCPv6
authorTomek Mrugalski <tomasz@isc.org>
Tue, 8 Dec 2015 17:21:20 +0000 (18:21 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 8 Dec 2015 17:21:20 +0000 (18:21 +0100)
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/dhcp6_srv.cc

index bd52a0405a6a1e46693be21e75e737614761872c..6ee16263a51083b28ed6c7ea78abe653a90eaecb 100644 (file)
@@ -224,6 +224,11 @@ client requested renewal of multiples leases (by sending multiple IA
 options), the server will skip the renewal of the one in question and
 will proceed with other renewals as usual.
 
+% DHCP6_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.
+
 % DHCP6_HOOK_PACKET_RCVD_SKIP received DHCPv6 packet was dropped because a callout set the skip flag
 This debug message is printed when a callout installed on the pkt6_receive
 hook point set the skip flag. For this particular hook point, the
index 0fdd23f20795c9878db249950c569d28588dd3b1..d705986cffa225ba71634427288993d0ccd855d3 100644 (file)
@@ -255,6 +255,8 @@ bool Dhcpv6Srv::run() {
         Pkt6Ptr query;
         Pkt6Ptr rsp;
 
+        try{
+
         try {
             // The lease database backend may install some timers for which
             // the handlers need to be executed periodically. Retrieve the
@@ -582,6 +584,18 @@ bool Dhcpv6Srv::run() {
                     .arg(e.what());
             }
         }
+
+        } catch (const std::exception& e) {
+            // General catch-all exception that are not caught by more specific
+            // catches.
+            LOG_ERROR(dhcp6_logger, DHCP6_PACKET_PROCESS_EXCEPTION)
+                .arg(e.what());
+        } catch (...) {
+            // General catch-all non-standard exception that are not caught
+            // by more specific catches.
+            LOG_ERROR(dhcp6_logger, DHCP6_PACKET_PROCESS_EXCEPTION)
+                .arg("an unknown exception not derived from std::exception");
+        }
     }
 
     return (true);