From a2d081467cc143f92d2a47394455ddc2b802cd0e Mon Sep 17 00:00:00 2001 From: Levon Tarver Date: Tue, 5 Dec 2023 01:33:01 +0000 Subject: [PATCH] Ensure ipv4 nat entry is active ensure_ipv4_nat_entry previously would match against *any* existing table entries with the matching parameters. We need it to only match against entries that are *active*, or in implementation terms, entries whose version_removed column is NULL. --- nexus/db-queries/src/db/datastore/ipv4_nat_entry.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/nexus/db-queries/src/db/datastore/ipv4_nat_entry.rs b/nexus/db-queries/src/db/datastore/ipv4_nat_entry.rs index 274937b299..5f6114b288 100644 --- a/nexus/db-queries/src/db/datastore/ipv4_nat_entry.rs +++ b/nexus/db-queries/src/db/datastore/ipv4_nat_entry.rs @@ -36,6 +36,7 @@ impl DataStore { .filter(dsl::sled_address.eq(nat_entry.sled_address)) .filter(dsl::vni.eq(nat_entry.vni)) .filter(dsl::mac.eq(nat_entry.mac)) + .filter(dsl::version_removed.is_null()) .select(( dsl::external_address, dsl::first_port,