Skip to content

Commit

Permalink
fix(upnp): use correct mapping protocol for UDP
Browse files Browse the repository at this point in the history
Return `PortMappingProtocol::UDP` when the multiaddress protocol is UDP.

Pull-Request: libp2p#4542.
  • Loading branch information
arpankapoor authored Sep 25, 2023
1 parent 6369666 commit 38ea7ad
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
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 @@ -97,7 +97,7 @@ libp2p-pnet = { version = "0.23.0", path = "transports/pnet" }
libp2p-quic = { version = "0.9.2", path = "transports/quic" }
libp2p-relay = { version = "0.16.1", path = "protocols/relay" }
libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" }
libp2p-upnp = { version = "0.1.0", path = "protocols/upnp" }
libp2p-upnp = { version = "0.1.1", path = "protocols/upnp" }
libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" }
libp2p-server = { version = "0.12.3", path = "misc/server" }
libp2p-swarm = { version = "0.43.4", path = "swarm" }
Expand Down
5 changes: 5 additions & 0 deletions protocols/upnp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.1 - unreleased

- Fix port mapping protocol used for a UDP multiaddress.
See [PR 4542](https://github.com/libp2p/rust-libp2p/pull/4542).

## 0.1.0

- Initial version
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 = "2021"
rust-version = "1.60.0"
description = "UPnP support for libp2p transports"
version = "0.1.0"
version = "0.1.1"
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking"]
Expand Down
2 changes: 1 addition & 1 deletion protocols/upnp/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ fn multiaddr_to_socketaddr_protocol(
Some(multiaddr::Protocol::Udp(port)) => {
return Ok((
SocketAddr::V4(SocketAddrV4::new(ipv4, port)),
PortMappingProtocol::TCP,
PortMappingProtocol::UDP,
));
}
_ => {}
Expand Down

0 comments on commit 38ea7ad

Please sign in to comment.