Skip to content

Commit 0e64d71

Browse files
authored
fix(server): filter out /quic in favor of /quic-v1
Configuration files generated by Kubo <= v0.22 list both `/quic` and `/quic-v1` listen addresses with the same UDP port. Given that we enable draft-29, the two addresses are treated the same by rust-libp2p's QUIC implementation. Though calling `listen_on` with both results in an "Address already in use" error by the OS on the second call. To prevent this from happening filter out `/quic` addresses in favor of `/quic-v1`. Pull-Request: #4467.
1 parent d1d358c commit 0e64d71

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

misc/server/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Changed
99
- Add libp2p-lookup to Dockerfile to enable healthchecks.
1010

11+
### Fixed
12+
13+
- Disable QUIC `draft-29` support.
14+
Listening on `/quic` and `/quic-v1` addresses with the same port would otherwise result in an "Address already in use" error by the OS.
15+
See [PR 4467].
16+
17+
[PR 4467]: https://github.com/libp2p/rust-libp2p/pull/4467
18+
1119
## [0.12.2]
1220
### Fixed
1321
- Adhere to `--metrics-path` flag and listen on `0.0.0.0:8888` (default IPFS metrics port).

misc/server/src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
8989
.multiplex(yamux::Config::default())
9090
.timeout(Duration::from_secs(20));
9191

92-
let quic_transport = {
93-
let mut config = quic::Config::new(&local_keypair);
94-
config.support_draft_29 = true;
95-
quic::tokio::Transport::new(config)
96-
};
92+
let quic_transport = quic::tokio::Transport::new(quic::Config::new(&local_keypair));
9793

9894
dns::TokioDnsConfig::system(libp2p::core::transport::OrTransport::new(
9995
quic_transport,
@@ -126,6 +122,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
126122
Err(e) => return Err(e.into()),
127123
}
128124
}
125+
129126
if config.addresses.append_announce.is_empty() {
130127
warn!("No external addresses configured.");
131128
}

0 commit comments

Comments
 (0)