From a2405d779a5874cc6df6066517db434de225894d Mon Sep 17 00:00:00 2001 From: Han Xu Date: Sun, 15 Feb 2026 11:35:36 -0800 Subject: [PATCH 1/6] update doc comments --- src/lib.rs | 4 ++-- src/service_info.rs | 15 ++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1f2717c..7fc80dd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -74,7 +74,7 @@ //! // Create a daemon //! let mdns = ServiceDaemon::new().expect("Failed to create daemon"); //! -//! // Recommended: Setup a monitor connection to receive events, especially errors from the daemon thread. +//! // Optional: setup a monitor channel to receive events, especially errors from the daemon. //! let receiver = mdns.monitor().expect("Failed to monitor daemon"); //! std::thread::spawn(move || { //! while let Ok(event) = receiver.recv() { @@ -88,7 +88,7 @@ //! }); //! //! // Create a service info. -//! // ❗ Make sure that the service name: "mdns-sd-my-test" is not longer than the max length limit. (15 characters by default) +//! // Make sure that the service name: "mdns-sd-my-test" is not longer than the max length limit (15 by default). //! let service_type = "_mdns-sd-my-test._udp.local."; //! let instance_name = "my_instance"; //! let ip = "192.168.1.12"; diff --git a/src/service_info.rs b/src/service_info.rs index 0f18d34..95b0f29 100644 --- a/src/service_info.rs +++ b/src/service_info.rs @@ -87,9 +87,10 @@ fn escape_instance_name(name: &str) -> String { /// as well as A (IPv4 Address) and AAAA (IPv6 Address) records. #[derive(Debug, Clone)] pub struct ServiceInfo { - // With default settings service name length must be <= 15 bytes - // so "_abcdefghijklmno._udp.local." would be valid but "_abcdefghijklmnop._udp.local." is not - ty_domain: String, // . + /// . + /// By default the service-type-name length must be <= 15. + /// so "_abcdefghijklmno._udp.local." would be valid but "_abcdefghijklmnop._udp.local." is not + ty_domain: String, /// See RFC6763 section 7.1 about "Subtypes": /// @@ -128,12 +129,8 @@ pub(crate) enum ServiceStatus { impl ServiceInfo { /// Creates a new service info. /// - /// `ty_domain` is the service type and the domain label, for example - /// "_my-service._udp.local.". - /// With default settings service name length must be <= 15 bytes - /// so "_abcdefghijklmno._udp.local." would be valid but "_abcdefghijklmnop._udp.local." is not - /// ❗ **This will fail with an error log which may not be noticed unless you properly setup logging**. - /// It is recommended to setup a monitor connection via `ServiceDaemon::monitor()` + /// `ty_domain` is the service type and the domain label, for example "_my-service._udp.local.". + /// By default the service type length must be <= 15 bytes /// /// `my_name` is the instance name, without the service type suffix. /// It allows dots (`.`) and backslashes (`\`). From 96c6cdd42ca90554a886875f9d5d3ec93e0fcd41 Mon Sep 17 00:00:00 2001 From: Han Xu Date: Sun, 15 Feb 2026 12:35:12 -0800 Subject: [PATCH 2/6] prepare a new release: v0.18.0 --- CHANGELOG.md | 21 +++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f10948..8d1a561 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +# Version 0.18.0 (2026-02-15) + +A few new features, documentation enhancements and breaking changes. + +## Breaking changes +- Removed one default feature: `reuseport`. It is handled transparently now. (see commit `58bc8c5`) +- New feature: support `.` and `/` in instance names (see commit `3481b94`) +- New internal feature: proper cleanup on daemon shutdown (see commit `8d24304`) +- New internal feature: exclude point-to-point interfaces by default (e.g. tunnel interface) (see commit `85b6cd9`) + +## All changes +* `b694333 2026-02-12` Added documentation about service name length (FelixSelter) +* `85b6cd9 2026-02-10` fix for macOS: exclude IFF_POINTTOPOINT interfaces and exclude Apple P2P interfaces by default (#425) (keepsimple1) +* `58bc8c5 2026-02-09` fix: invert reuseport feature (#430) (keepsimple1) +* `8d24304 2026-02-07` feat: add proper cleanup on daemon shutdown (#421) (Thibaut M.) +* `69418d6 2026-02-05` chore: update some comments (#429) (keepsimple1) +* `3481b94 2026-02-06` feat: implement RFC 6763 Section 4.3 escaping for instance names (#420) (Thibaut M.) +* `58c15b4 2026-01-27` fix: only add a scope in Display to unicast link local v6 addresses (#424) (hrzlgnm) +* `3f34136 2026-01-24` Return errors from send_dns_outgoing (#419) (keepsimple1) +* `0e323f6 2026-01-21` ci: update github action checkout (#422) (Thibaut M.) + # Version 0.17.2 (2026-01-16) ## New features (non-breaking) diff --git a/Cargo.toml b/Cargo.toml index dc2941c..ba690f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mdns-sd" -version = "0.17.2" +version = "0.18.0" authors = ["keepsimple "] edition = "2018" rust-version = "1.71.0" From 815e4972026869f78d1c0b72d3379816a6f7298f Mon Sep 17 00:00:00 2001 From: Han Xu Date: Sun, 15 Feb 2026 14:22:13 -0800 Subject: [PATCH 3/6] update CHANGELOG --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d1a561..25e1321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ A few new features, documentation enhancements and breaking changes. ## Breaking changes - Removed one default feature: `reuseport`. It is handled transparently now. (see commit `58bc8c5`) -- New feature: support `.` and `/` in instance names (see commit `3481b94`) -- New internal feature: proper cleanup on daemon shutdown (see commit `8d24304`) -- New internal feature: exclude point-to-point interfaces by default (e.g. tunnel interface) (see commit `85b6cd9`) +- New feature: support `.` and `\` in instance names (see commit `3481b94`) +- New internal fix: proper cleanup on daemon shutdown (see commit `8d24304`) +- New internal fix: exclude point-to-point interfaces by default (e.g. tunnel interface) (see commit `85b6cd9`) ## All changes * `b694333 2026-02-12` Added documentation about service name length (FelixSelter) @@ -19,6 +19,8 @@ A few new features, documentation enhancements and breaking changes. * `3f34136 2026-01-24` Return errors from send_dns_outgoing (#419) (keepsimple1) * `0e323f6 2026-01-21` ci: update github action checkout (#422) (Thibaut M.) +Thanks and welcome new contributors: @thibaut-pascal, @FelixSelter + # Version 0.17.2 (2026-01-16) ## New features (non-breaking) From f9bcdc9f6452c236e8373e2abfa330e0637432d8 Mon Sep 17 00:00:00 2001 From: Han Xu Date: Sun, 15 Feb 2026 14:23:11 -0800 Subject: [PATCH 4/6] fix doc --- src/service_info.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service_info.rs b/src/service_info.rs index 95b0f29..22261b0 100644 --- a/src/service_info.rs +++ b/src/service_info.rs @@ -87,7 +87,7 @@ fn escape_instance_name(name: &str) -> String { /// as well as A (IPv4 Address) and AAAA (IPv6 Address) records. #[derive(Debug, Clone)] pub struct ServiceInfo { - /// . + /// Service type and domain: {service-type-name}.{domain} /// By default the service-type-name length must be <= 15. /// so "_abcdefghijklmno._udp.local." would be valid but "_abcdefghijklmnop._udp.local." is not ty_domain: String, From 132428766285f1b7de28eb59d5265f89661cc9ad Mon Sep 17 00:00:00 2001 From: Han Xu Date: Sun, 15 Feb 2026 14:45:45 -0800 Subject: [PATCH 5/6] fix Test interference between test_cache_only and test_cache_only_unsolicited --- src/service_daemon.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/service_daemon.rs b/src/service_daemon.rs index 29a0b23..7e3d4aa 100644 --- a/src/service_daemon.rs +++ b/src/service_daemon.rs @@ -5258,10 +5258,9 @@ mod tests { #[test] fn test_cache_only_unsolicited() { - // construct service info - let service_type = "_cache_only._udp.local."; + let service_type = "_c_unsolicit._udp.local."; let instance = "test_instance"; - let host_name = "cache_only_host.local."; + let host_name = "c_unsolicit_host.local."; let service_ip_addr = my_ip_interfaces(false) .iter() .find(|iface| iface.ip().is_ipv4()) From 0821b08d47ff6fe6db8b627b96394a1b8934f4f8 Mon Sep 17 00:00:00 2001 From: Han Xu Date: Sun, 15 Feb 2026 14:48:28 -0800 Subject: [PATCH 6/6] make test more robust --- src/service_daemon.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/service_daemon.rs b/src/service_daemon.rs index 7e3d4aa..4ab6992 100644 --- a/src/service_daemon.rs +++ b/src/service_daemon.rs @@ -5267,7 +5267,7 @@ mod tests { .map(|iface| iface.ip()) .unwrap(); - let mut my_service = ServiceInfo::new( + let my_service = ServiceInfo::new( service_type, instance, host_name, @@ -5277,9 +5277,6 @@ mod tests { ) .unwrap(); - let new_ttl = 3; // for testing only. - my_service._set_other_ttl(new_ttl); - // register my service let mdns_server = ServiceDaemon::new().expect("Failed to create mdns server"); let result = mdns_server.register(my_service);