]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3648] drop packet on db race
authorRazvan Becheriu <razvan@isc.org>
Fri, 14 Mar 2025 08:01:44 +0000 (10:01 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 14 Mar 2025 11:09:26 +0000 (13:09 +0200)
src/lib/dhcpsrv/alloc_engine.cc

index 67c85f1ce9b5b0193d707f7e6dcc5334acf8f664..1294e999e4ec0395dad7ade2590008a81a4189bc 100644 (file)
@@ -15,6 +15,7 @@
 #include <dhcpsrv/alloc_engine.h>
 #include <dhcpsrv/alloc_engine_log.h>
 #include <dhcpsrv/cfgmgr.h>
+#include <dhcpsrv/dhcpsrv_exceptions.h>
 #include <dhcpsrv/dhcpsrv_log.h>
 #include <dhcpsrv/host_mgr.h>
 #include <dhcpsrv/host.h>
@@ -629,6 +630,9 @@ AllocEngine::allocateLeases6(ClientContext6& ctx) {
             return (leases);
         }
 
+    } catch (const NoSuchLease&) {
+        throw;
+
     } catch (const isc::Exception& e) {
 
         // Some other error, return an empty lease.
@@ -2182,6 +2186,9 @@ AllocEngine::renewLeases6(ClientContext6& ctx) {
 
         return (leases);
 
+    } catch (const NoSuchLease&) {
+        throw;
+
     } catch (const isc::Exception& e) {
 
         // Some other error, return an empty lease.
@@ -3746,6 +3753,9 @@ AllocEngine::allocateLease4(ClientContext4& ctx) {
             ctx.new_lease_ = requestLease4(ctx);
         }
 
+    } catch (const NoSuchLease&) {
+        throw;
+
     } catch (const isc::Exception& e) {
         // Some other error, return an empty lease.
         LOG_ERROR(alloc_engine_logger, ALLOC_ENGINE_V4_ALLOC_ERROR)