Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ newtype_derive = "0.1.6"
ntp-admin-api = { path = "ntp-admin/api" }
ntp-admin-client = { path = "clients/ntp-admin-client" }
ntp-admin-types = { path = "ntp-admin/types" }
mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "08f2a34d487658e87545ffbba3add632a82baf0d" }
ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "08f2a34d487658e87545ffbba3add632a82baf0d" }
mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" }
ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" }
multimap = "0.10.1"
nexus-auth = { path = "nexus/auth" }
nexus-background-task-interface = { path = "nexus/background-task-interface" }
Expand Down Expand Up @@ -667,6 +667,7 @@ ratatui = "0.29.0"
raw-cpuid = { git = "https://github.com/oxidecomputer/rust-cpuid.git", rev = "a4cf01df76f35430ff5d39dc2fe470bcb953503b" }
rayon = "1.10"
rcgen = "0.12.1"
rdb-types = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" }
reconfigurator-cli = { path = "dev-tools/reconfigurator-cli" }
reedline = "0.40.0"
ref-cast = "1.0"
Expand Down
8 changes: 8 additions & 0 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3291,6 +3291,11 @@ pub enum BgpPeerState {
/// Waiting for keepaliave or notification from peer.
OpenConfirm,

/// There is an ongoing Connection Collision that hasn't yet been resolved.
/// Two connections are maintained until one connection receives an Open or
/// is able to progress into Established.
ConnectionCollision,

/// Synchronizing with peer.
SessionSetup,

Expand All @@ -3308,6 +3313,9 @@ impl From<mg_admin_client::types::FsmStateKind> for BgpPeerState {
FsmStateKind::Active => BgpPeerState::Active,
FsmStateKind::OpenSent => BgpPeerState::OpenSent,
FsmStateKind::OpenConfirm => BgpPeerState::OpenConfirm,
FsmStateKind::ConnectionCollision => {
BgpPeerState::ConnectionCollision
}
FsmStateKind::SessionSetup => BgpPeerState::SessionSetup,
FsmStateKind::Established => BgpPeerState::Established,
}
Expand Down
1 change: 1 addition & 0 deletions nexus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ qorb.workspace = true
rand.workspace = true
range-requests.workspace = true
ref-cast.workspace = true
rdb-types.workspace = true
regex.workspace = true
reqwest = { workspace = true, features = ["json"] }
ring.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions nexus/db-queries/src/db/datastore/vpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3907,21 +3907,21 @@ mod tests {
assert!(resolved.iter().any(|x| {
let k = &x.dest;
let v = &x.target;
*k == subnet.ipv4_block.0.into()
*k == IpNet::from(subnet.ipv4_block.0)
&& match v {
RouterTarget::VpcSubnet(ip) => {
*ip == subnet.ipv4_block.0.into()
*ip == IpNet::from(subnet.ipv4_block.0)
}
_ => false,
}
}));
assert!(resolved.iter().any(|x| {
let k = &x.dest;
let v = &x.target;
*k == subnet.ipv6_block.0.into()
*k == IpNet::from(subnet.ipv6_block.0)
&& match v {
RouterTarget::VpcSubnet(ip) => {
*ip == subnet.ipv6_block.0.into()
*ip == IpNet::from(subnet.ipv6_block.0)
}
_ => false,
}
Expand Down
2 changes: 1 addition & 1 deletion nexus/src/app/background/tasks/bfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl BackgroundTask for BfdManager {
},
};

let mgd_clients = build_mgd_clients(mappings, log);
let mgd_clients = build_mgd_clients(mappings, log, &self.resolver).await;

for (location, c) in &mgd_clients {
let client_current = match c.get_bfd_peers().await {
Expand Down
25 changes: 22 additions & 3 deletions nexus/src/app/background/tasks/networking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,37 @@ use db::datastore::SwitchPortSettingsCombinedResult;
use dpd_client::types::{
LinkCreate, LinkId, LinkSettings, PortFec, PortSettings, PortSpeed, TxEq,
};
use internal_dns_types::names::ServiceName;
use nexus_db_model::{SwitchLinkFec, SwitchLinkSpeed};
use nexus_db_queries::db;
use omicron_common::{address::MGD_PORT, api::external::SwitchLocation};
use std::{collections::HashMap, net::SocketAddrV6};
use std::{
collections::HashMap,
net::{Ipv6Addr, SocketAddrV6},
};

pub(crate) fn build_mgd_clients(
pub(crate) async fn build_mgd_clients(
mappings: HashMap<SwitchLocation, std::net::Ipv6Addr>,
log: &slog::Logger,
resolver: &internal_dns_resolver::Resolver,
) -> HashMap<SwitchLocation, mg_admin_client::Client> {
let mut clients: Vec<(SwitchLocation, mg_admin_client::Client)> = vec![];
for (location, addr) in &mappings {
let port = MGD_PORT;
let port = match resolver.lookup_all_socket_v6(ServiceName::Mgd).await {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special scrutiny is warranted here. I think this should be ok as we fallback to the previous constant port when DNS does not work out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as noted above

Ok(addrs) => {
let port_map: HashMap<Ipv6Addr, u16> = addrs
.into_iter()
.map(|sockaddr| (*sockaddr.ip(), sockaddr.port()))
.collect();

*port_map.get(&addr).unwrap_or(&MGD_PORT)
}
Err(e) => {
error!(log, "failed to addresses"; "error" => %e);
MGD_PORT
}
};

let socketaddr =
std::net::SocketAddr::V6(SocketAddrV6::new(*addr, port, 0, 0));
let client = mg_admin_client::Client::new(
Expand Down
Loading
Loading