This commit is contained in:
Christien Rioux 2023-09-10 11:24:52 -04:00
parent f7ee2635b3
commit 607b595807
3 changed files with 15 additions and 15 deletions

View File

@ -420,7 +420,7 @@ impl DiscoveryContext {
}; };
// If we have two different external addresses, then this is a symmetric NAT // If we have two different external addresses, then this is a symmetric NAT
if external_2.address != external_1.address { if external_2.address.address() != external_1.address.address() {
let do_symmetric_nat_fut: SendPinBoxFuture<Option<DetectedDialInfo>> = let do_symmetric_nat_fut: SendPinBoxFuture<Option<DetectedDialInfo>> =
Box::pin(async move { Some(DetectedDialInfo::SymmetricNAT) }); Box::pin(async move { Some(DetectedDialInfo::SymmetricNAT) });
unord.push(do_symmetric_nat_fut); unord.push(do_symmetric_nat_fut);

View File

@ -11,19 +11,6 @@ impl Network {
.get_network_class(RoutingDomain::PublicInternet) .get_network_class(RoutingDomain::PublicInternet)
.unwrap_or_default(); .unwrap_or_default();
// get existing dial info into table by protocol/address type
let mut existing_dial_info = BTreeMap::<(ProtocolType, AddressType), DialInfoDetail>::new();
for did in self.routing_table().all_filtered_dial_info_details(
RoutingDomain::PublicInternet.into(),
&DialInfoFilter::all(),
) {
// Only need to keep one per pt/at pair, since they will all have the same dialinfoclass
existing_dial_info.insert(
(did.dial_info.protocol_type(), did.dial_info.address_type()),
did,
);
}
match ddi { match ddi {
DetectedDialInfo::SymmetricNAT => { DetectedDialInfo::SymmetricNAT => {
// If we get any symmetric nat dialinfo, this whole network class is outbound only, // If we get any symmetric nat dialinfo, this whole network class is outbound only,
@ -39,6 +26,19 @@ impl Network {
} }
} }
DetectedDialInfo::Detected(did) => { DetectedDialInfo::Detected(did) => {
// get existing dial info into table by protocol/address type
let mut existing_dial_info =
BTreeMap::<(ProtocolType, AddressType), DialInfoDetail>::new();
for did in self.routing_table().all_filtered_dial_info_details(
RoutingDomain::PublicInternet.into(),
&DialInfoFilter::all(),
) {
// Only need to keep one per pt/at pair, since they will all have the same dialinfoclass
existing_dial_info.insert(
(did.dial_info.protocol_type(), did.dial_info.address_type()),
did,
);
}
// We got a dial info, upgrade everything unless we are fixed to outbound only due to a symmetric nat // We got a dial info, upgrade everything unless we are fixed to outbound only due to a symmetric nat
if !matches!(existing_network_class, NetworkClass::OutboundOnly) { if !matches!(existing_network_class, NetworkClass::OutboundOnly) {
// Get existing dial info for protocol/address type combination // Get existing dial info for protocol/address type combination

View File

@ -648,7 +648,7 @@ impl VeilidAPI {
if !args.is_empty() { if !args.is_empty() {
if args[0] == "buckets" { if args[0] == "buckets" {
// Must be detached // Must be detached
if matches!( if !matches!(
self.get_state().await?.attachment.state, self.get_state().await?.attachment.state,
AttachmentState::Detached | AttachmentState::Detaching AttachmentState::Detached | AttachmentState::Detaching
) { ) {