diff --git a/nexus/db-model/src/switch_port.rs b/nexus/db-model/src/switch_port.rs index 48afd7b52a..f790d7d527 100644 --- a/nexus/db-model/src/switch_port.rs +++ b/nexus/db-model/src/switch_port.rs @@ -642,9 +642,13 @@ pub struct SwitchPortBgpPeerConfigCommunity { )] #[diesel(table_name = switch_port_settings_bgp_peer_config_allow_export)] pub struct SwitchPortBgpPeerConfigAllowExport { + /// Parent switch port configuration pub port_settings_id: Uuid, + /// Interface peer is reachable on pub interface_name: String, + /// Peer Address pub addr: IpNetwork, + /// Allowed Prefix pub prefix: IpNetwork, } @@ -660,9 +664,13 @@ pub struct SwitchPortBgpPeerConfigAllowExport { )] #[diesel(table_name = switch_port_settings_bgp_peer_config_allow_import)] pub struct SwitchPortBgpPeerConfigAllowImport { + /// Parent switch port configuration pub port_settings_id: Uuid, + /// Interface peer is reachable on pub interface_name: String, + /// Peer Address pub addr: IpNetwork, + /// Allowed Prefix pub prefix: IpNetwork, } diff --git a/nexus/db-queries/src/db/datastore/bgp.rs b/nexus/db-queries/src/db/datastore/bgp.rs index 1244184c1d..f4bea0f605 100644 --- a/nexus/db-queries/src/db/datastore/bgp.rs +++ b/nexus/db-queries/src/db/datastore/bgp.rs @@ -606,6 +606,7 @@ impl DataStore { .transaction(&conn, |conn| async move { let active = peer_dsl::switch_port_settings_bgp_peer_config .filter(db_peer::port_settings_id.eq(port_settings_id)) + .filter(db_peer::addr.eq(addr)) .select(db_peer::allow_export_list_active) .limit(1) .first_async::(&conn) @@ -652,6 +653,7 @@ impl DataStore { .transaction(&conn, |conn| async move { let active = peer_dsl::switch_port_settings_bgp_peer_config .filter(db_peer::port_settings_id.eq(port_settings_id)) + .filter(db_peer::addr.eq(addr)) .select(db_peer::allow_import_list_active) .limit(1) .first_async::(&conn)