Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ libp2p-swarm-test = { version = "0.6.0", path = "swarm-test" }
libp2p-tcp = { version = "0.44.0", path = "transports/tcp" }
libp2p-tls = { version = "0.6.2", path = "transports/tls" }
libp2p-uds = { version = "0.43.0", path = "transports/uds" }
libp2p-upnp = { version = "0.5.0", path = "protocols/upnp" }
libp2p-upnp = { version = "0.5.1", path = "protocols/upnp" }
libp2p-webrtc = { version = "0.9.0-alpha.1", path = "transports/webrtc" }
libp2p-webrtc-utils = { version = "0.4.0", path = "misc/webrtc-utils" }
libp2p-webrtc-websys = { version = "0.4.0", path = "transports/webrtc-websys" }
Expand Down
8 changes: 8 additions & 0 deletions protocols/upnp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.5.1

- Skip port mapping when an active port mapping is present.
Previously, the behavior would skip creating new mappings if any mapping
(active or inactive or pending) existed for the same port. Now it correctly only
checks active mappings on the gateway.
See [PR 6127](https://github.com/libp2p/rust-libp2p/pull/6127).

## 0.5.0

- update igd-next to 0.16.1
Expand Down
2 changes: 1 addition & 1 deletion protocols/upnp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-upnp"
edition.workspace = true
rust-version.workspace = true
description = "UPnP support for libp2p transports"
version = "0.5.0"
version = "0.5.1"
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking"]
Expand Down
11 changes: 5 additions & 6 deletions protocols/upnp/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,14 @@ impl NetworkBehaviour for Behaviour {
return;
};

if let Some((mapping, _state)) = self
.mappings
.iter()
.find(|(mapping, _state)| mapping.internal_addr.port() == addr.port())
{
if let Some((mapping, _state)) = self.mappings.iter().find(|(mapping, state)| {
matches!(state, MappingState::Active(_))
&& mapping.internal_addr.port() == addr.port()
}) {
tracing::debug!(
multiaddress=%multiaddr,
mapped_multiaddress=%mapping.multiaddr,
"port from multiaddress is already being mapped"
"port from multiaddress is already mapped on the gateway"
);
return;
}
Expand Down
Loading