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
3 changes: 3 additions & 0 deletions protocols/mdns/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

- Fix a bug that could cause a delay of ~10s until peers would get discovered when using the tokio runtime. See [PR 2939].

- Removed the `lazy_static` dependency. See [PR 2977].

[PR 2918]: https://github.com/libp2p/rust-libp2p/pull/2918
[PR 2939]: https://github.com/libp2p/rust-libp2p/pull/2939
[PR 2977]: https://github.com/libp2p/rust-libp2p/pull/2977

# 0.40.0

Expand Down
1 change: 0 additions & 1 deletion protocols/mdns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ data-encoding = "2.3.2"
dns-parser = "0.8.0"
futures = "0.3.13"
if-watch = "1.1.1"
lazy_static = "1.4.0"
libp2p-core = { version = "0.37.0", path = "../../core" }
libp2p-swarm = { version = "0.40.0", path = "../../swarm" }
log = "0.4.14"
Expand Down
4 changes: 2 additions & 2 deletions protocols/mdns/src/behaviour/iface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ where
config.query_interval + Duration::from_millis(jitter)
};
let multicast_addr = match addr {
IpAddr::V4(_) => IpAddr::V4(*crate::IPV4_MDNS_MULTICAST_ADDRESS),
IpAddr::V6(_) => IpAddr::V6(*crate::IPV6_MDNS_MULTICAST_ADDRESS),
IpAddr::V4(_) => IpAddr::V4(crate::IPV4_MDNS_MULTICAST_ADDRESS),
IpAddr::V6(_) => IpAddr::V6(crate::IPV6_MDNS_MULTICAST_ADDRESS),
};
Ok(Self {
addr,
Expand Down
8 changes: 2 additions & 6 deletions protocols/mdns/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
//! implements the `NetworkBehaviour` trait. This struct will automatically discover other
//! libp2p nodes on the local network.
//!
use lazy_static::lazy_static;
use std::net::{Ipv4Addr, Ipv6Addr};
use std::time::Duration;

Expand All @@ -48,11 +47,8 @@ const SERVICE_NAME: &[u8] = b"_p2p._udp.local";
/// The meta query for looking up the `SERVICE_NAME`.
const META_QUERY_SERVICE: &[u8] = b"_services._dns-sd._udp.local";

lazy_static! {
pub static ref IPV4_MDNS_MULTICAST_ADDRESS: Ipv4Addr = Ipv4Addr::new(224, 0, 0, 251);
pub static ref IPV6_MDNS_MULTICAST_ADDRESS: Ipv6Addr =
Ipv6Addr::new(0xFF02, 0, 0, 0, 0, 0, 0, 0xFB);
}
pub const IPV4_MDNS_MULTICAST_ADDRESS: Ipv4Addr = Ipv4Addr::new(224, 0, 0, 251);
pub const IPV6_MDNS_MULTICAST_ADDRESS: Ipv6Addr = Ipv6Addr::new(0xFF02, 0, 0, 0, 0, 0, 0, 0xFB);

/// Configuration for mDNS.
#[derive(Debug, Clone)]
Expand Down