Skip to content

Commit da8763c

Browse files
fix(autonat): prevent infinity loop on wrong nonce
Fix #5816. Pull-Request: #5848.
1 parent 70479f7 commit da8763c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ rust-version = "1.83.0"
7474
[workspace.dependencies]
7575
libp2p = { version = "0.55.1", path = "libp2p" }
7676
libp2p-allow-block-list = { version = "0.5.0", path = "misc/allow-block-list" }
77-
libp2p-autonat = { version = "0.14.0", path = "protocols/autonat" }
77+
libp2p-autonat = { version = "0.14.1", path = "protocols/autonat" }
7878
libp2p-connection-limits = { version = "0.5.0", path = "misc/connection-limits" }
7979
libp2p-core = { version = "0.43.0", path = "core" }
8080
libp2p-dcutr = { version = "0.13.0", path = "protocols/dcutr" }

protocols/autonat/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.14.1
2+
3+
- Fix infinity loop on wrong `nonce` when performing `dial_back`.
4+
See [PR 5848](https://github.com/libp2p/rust-libp2p/pull/5848).
5+
16
## 0.14.0
27

38
- Verify that an incoming AutoNAT dial comes from a connected peer. See [PR 5597](https://github.com/libp2p/rust-libp2p/pull/5597).

protocols/autonat/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-autonat"
33
edition = "2021"
44
rust-version = { workspace = true }
55
description = "NAT and firewall detection for libp2p"
6-
version = "0.14.0"
6+
version = "0.14.1"
77
authors = [
88
"David Craven <[email protected]>",
99
"Elena Frank <[email protected]>",

protocols/autonat/src/v2/client/handler/dial_back.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,7 @@ fn perform_dial_back(
109109
match receiver.await {
110110
Ok(Ok(())) => {}
111111
Ok(Err(e)) => return Some((Err(e), state)),
112-
Err(_) => {
113-
return Some((
114-
Err(io::Error::new(io::ErrorKind::Other, "Sender got cancelled")),
115-
state,
116-
));
117-
}
112+
Err(_) => return None,
118113
}
119114
if let Err(e) = protocol::dial_back_response(&mut state.stream).await {
120115
return Some((Err(e), state));

0 commit comments

Comments
 (0)