diff --git a/veilid-core/src/network_manager/native/network_class_discovery.rs b/veilid-core/src/network_manager/native/network_class_discovery.rs index c6a4ae8a..3de494e1 100644 --- a/veilid-core/src/network_manager/native/network_class_discovery.rs +++ b/veilid-core/src/network_manager/native/network_class_discovery.rs @@ -148,7 +148,8 @@ impl DiscoveryContext { entry.with(rti, move |_rti, e| { e.node_info(routing_domain) .map(|ni| { - ni.has_capability(CAP_VALIDATE_DIAL_INFO) && ni.is_signal_capable() + ni.has_capability(CAP_VALIDATE_DIAL_INFO) + && ni.is_fully_direct_inbound() }) .unwrap_or(false) }) diff --git a/veilid-core/src/routing_table/tasks/relay_management.rs b/veilid-core/src/routing_table/tasks/relay_management.rs index 4b0f36ce..95612f8a 100644 --- a/veilid-core/src/routing_table/tasks/relay_management.rs +++ b/veilid-core/src/routing_table/tasks/relay_management.rs @@ -112,8 +112,8 @@ impl RoutingTable { let can_serve_as_relay = e .node_info(RoutingDomain::PublicInternet) .map(|n| { - if !(n.has_capability(CAP_RELAY) && n.is_signal_capable()) { - // Needs to be able to signal and relay + if !(n.has_capability(CAP_RELAY) && n.is_fully_direct_inbound()) { + // Needs to be able to accept packets to relay directly return false; } diff --git a/veilid-core/src/routing_table/types/node_info.rs b/veilid-core/src/routing_table/types/node_info.rs index 96c40637..4bbf31da 100644 --- a/veilid-core/src/routing_table/types/node_info.rs +++ b/veilid-core/src/routing_table/types/node_info.rs @@ -211,15 +211,8 @@ impl NodeInfo { true } - /// Can this node assist with signalling? Yes but only if it doesn't require signalling, itself. - /// Also used to determine if nodes are capable of validation of dial info, as that operation - /// has the same requirements, inbound capability and a dial info that requires no assistance - pub fn is_signal_capable(&self) -> bool { - // Has capability? - if !self.has_capability(CAP_SIGNAL) { - return false; - } - + /// Can direct connections be made + pub fn is_fully_direct_inbound(&self) -> bool { // Must be inbound capable if !matches!(self.network_class, NetworkClass::InboundCapable) { return false; diff --git a/veilid-core/src/rpc_processor/rpc_signal.rs b/veilid-core/src/rpc_processor/rpc_signal.rs index 4e32952a..4b325d73 100644 --- a/veilid-core/src/rpc_processor/rpc_signal.rs +++ b/veilid-core/src/rpc_processor/rpc_signal.rs @@ -41,7 +41,8 @@ impl RPCProcessor { let routing_table = self.routing_table(); { if let Some(opi) = routing_table.get_own_peer_info(msg.header.routing_domain()) { - if !opi.signed_node_info().node_info().is_signal_capable() { + let ni = opi.signed_node_info().node_info(); + if !ni.has_capability(CAP_SIGNAL) { return Ok(NetworkResult::service_unavailable( "signal is not available", )); diff --git a/veilid-core/src/rpc_processor/rpc_validate_dial_info.rs b/veilid-core/src/rpc_processor/rpc_validate_dial_info.rs index 16598b31..37eaef96 100644 --- a/veilid-core/src/rpc_processor/rpc_validate_dial_info.rs +++ b/veilid-core/src/rpc_processor/rpc_validate_dial_info.rs @@ -72,7 +72,7 @@ impl RPCProcessor { { if let Some(opi) = routing_table.get_own_peer_info(detail.routing_domain) { let ni = opi.signed_node_info().node_info(); - if !ni.has_capability(CAP_VALIDATE_DIAL_INFO) || !ni.is_signal_capable() { + if !ni.has_capability(CAP_VALIDATE_DIAL_INFO) || !ni.is_fully_direct_inbound() { return Ok(NetworkResult::service_unavailable( "validate dial info is not available", )); @@ -118,7 +118,8 @@ impl RPCProcessor { entry.with(rti, move |_rti, e| { e.node_info(routing_domain) .map(|ni| { - ni.has_capability(CAP_VALIDATE_DIAL_INFO) && ni.is_signal_capable() + ni.has_capability(CAP_VALIDATE_DIAL_INFO) + && ni.is_fully_direct_inbound() }) .unwrap_or(false) })