Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(iroh-net): Move PathState to its own module #2587

Merged
merged 14 commits into from
Aug 9, 2024
5 changes: 4 additions & 1 deletion iroh-net/src/magicsock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,10 @@ impl MagicSock {
let dest = QuicMappedAddr(dest);

let mut transmits_sent = 0;
match self.node_map.get_send_addrs(dest) {
match self
.node_map
.get_send_addrs(dest, self.ipv6_reported.load(Ordering::Relaxed))
{
Some((public_key, udp_addr, relay_url, mut msgs)) => {
let mut pings_sent = false;
// If we have pings to send, we *have* to send them out first.
Expand Down
5 changes: 4 additions & 1 deletion iroh-net/src/magicsock/node_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ use crate::{

mod best_addr;
mod node_state;
mod path_state;
mod udp_paths;

pub use node_state::{ConnectionType, ControlMsg, DirectAddrInfo, NodeInfo};
pub(super) use node_state::{DiscoPingPurpose, PingAction, PingRole, SendPing};
Expand Down Expand Up @@ -186,6 +188,7 @@ impl NodeMap {
pub(super) fn get_send_addrs(
&self,
addr: QuicMappedAddr,
have_ipv6: bool,
) -> Option<(
PublicKey,
Option<SocketAddr>,
Expand All @@ -195,7 +198,7 @@ impl NodeMap {
let mut inner = self.inner.lock();
let ep = inner.get_mut(NodeStateKey::QuicMappedAddr(addr))?;
let public_key = *ep.public_key();
let (udp_addr, relay_url, msgs) = ep.get_send_addrs();
let (udp_addr, relay_url, msgs) = ep.get_send_addrs(have_ipv6);
Some((public_key, udp_addr, relay_url, msgs))
}

Expand Down
Loading
Loading