]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[support8785] std::exception, not just isc::Exception is caught
authorTomek Mrugalski <tomasz@isc.org>
Mon, 17 Aug 2015 18:49:39 +0000 (20:49 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Thu, 20 Aug 2015 12:57:05 +0000 (14:57 +0200)
  If std::exception would be thrown anywhere in message processing
  in Dhcp4Srv::run(), we would not catch it. In principle, that
  should never happen, as the Kea code only throws isc::Exception
  derivatives, but maybe some of the system or boost calls could
  throw std::exception.

src/bin/dhcp4/dhcp4_srv.cc

index b9de44a94684ce658ad19aebc9e65ce0dbf4dd61..f3ad0ca97e0f6ab163a9af17ff99bc984c50c464 100644 (file)
@@ -617,11 +617,12 @@ Dhcpv4Srv::run() {
                 // "switch" statement.
                 ;
             }
-        } catch (const isc::Exception& e) {
+        } catch (const std::exception& e) {
 
-            // Catch-all exception (at least for ones based on the isc Exception
-            // class, which covers more or less all that are explicitly raised
-            // in the Kea code).  Just log the problem and ignore the packet.
+            // Catch-all exception (we used to call only isc::Exception, but
+            // std::exception could potentially be raised and if we don't catch
+            // it here, it would be caught in main() and the process would
+            // terminate).  Just log the problem and ignore the packet.
             // (The problem is logged as a debug message because debug is
             // disabled by default - it prevents a DDOS attack based on the
             // sending of problem packets.)