Skip to content

Commit 087f003

Browse files
committed
fix(iroh): always ping new paths
1 parent 9866f0e commit 087f003

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

iroh/src/magicsock/node_map/node_state.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,13 @@ impl NodeState {
789789
self.prune_direct_addresses();
790790
}
791791

792-
// if the endpoint does not yet have a best_addrr
792+
// if the endpoint does not yet have a best_addr, or if this is a new path
793793
let needs_ping_back = if matches!(path, SendAddr::Udp(_))
794-
&& matches!(
794+
&& (matches!(
795795
self.udp_paths.best_addr.state(now),
796796
best_addr::State::Empty | best_addr::State::Outdated(_)
797-
) {
797+
) || matches!(role, PingRole::NewPath))
798+
{
798799
// We also need to send a ping to make this path available to us as well. This
799800
// is always sent together with a pong. So in the worst case the pong gets lost
800801
// and this ping does not. In that case we ping-pong until both sides have

0 commit comments

Comments
 (0)