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
1 change: 1 addition & 0 deletions src/dns_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@ impl DnsOutPacket {
//
// This function also handles RFC 6763 Section 4.3 escaping where dots and backslashes
// in instance names are escaped (e.g., "My\\.Service" represents a single label "My.Service").
// The actual name sent over the wire is the unescaped version.
fn write_name(&mut self, name: &str) {
// Remove trailing dot if present
let name_to_parse = name.strip_suffix('.').unwrap_or(name);
Expand Down
5 changes: 4 additions & 1 deletion src/service_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ impl From<&MyIntf> for InterfaceId {

/// Escapes dots and backslashes in a DNS instance name according to RFC 6763 Section 4.3.
/// - '.' becomes '\.'
/// - '\\' becomes '\\\\'
/// - '\' becomes '\\'
///
/// Note: `\` itself needs to be escaped in the source code.
///
/// This is required when concatenating the three portions of a Service Instance Name
/// to ensure that literal dots in the instance name are not interpreted as label separators.
Expand Down Expand Up @@ -128,6 +130,7 @@ impl ServiceInfo {
/// "_my-service._udp.local.".
///
/// `my_name` is the instance name, without the service type suffix.
/// It allows dots (`.`) and backslashes (`\`).
///
/// `host_name` is the "host" in the context of DNS. It is used as the "name"
/// in the address records (i.e. TYPE_A and TYPE_AAAA records). It means that
Expand Down