[mdns] Split response packets if necessary. (#1877)

* [mdns] Split response packets.

Prevent MDNS response packets becoming too large by creating
multi-packet responses. Also skip addresses that don't fit
into a TXT record or contain invalid characters.

* Update protocols/mdns/src/dns.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* Refactor response packet construction.

* Update mdns changelog.

Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Roman Borschel
2020-12-08 11:47:35 +01:00
committed by GitHub
parent e665a818d7
commit 4c1657ea0f
5 changed files with 142 additions and 93 deletions

View File

@ -30,9 +30,9 @@
//! struct will automatically discover other libp2p nodes on the local network.
//!
/// Hardcoded name of the mDNS service. Part of the mDNS libp2p specifications.
/// The DNS service name for all libp2p peers used to query for addresses.
const SERVICE_NAME: &[u8] = b"_p2p._udp.local";
/// Hardcoded name of the service used for DNS-SD.
/// The meta query for looking up the `SERVICE_NAME`.
const META_QUERY_SERVICE: &[u8] = b"_services._dns-sd._udp.local";
pub use crate::{