Skip to content

Conversation

@hrzlgnm
Copy link
Contributor

@hrzlgnm hrzlgnm commented Jan 21, 2026

The scope id only makes sense in case the address is a v6 uni-cast link local address.

Before the change the output of the query example, facing multiple ipv6 addresses with different scopes would be:

At 7.939648ms: Resolved a new service: FritzBoxRepeater._fbox._tcp.local.
 host: FritzBoxRepeater.fritz.box.
 port: 49000
 Address: 192.168.178.89
 Address: fd00::ca0e:14ff:feff:416%enp12s0 <- is an ULA (Unique Local Address, fc00::/7)
 Address: 2003:e8:bf1e:9b00:ca0e:14ff:feff:416%enp12s0 <- is globally scoped
 Address: fe80::ca0e:14ff:feff:416%enp12s0 <- only here it makes sense

After:

At 6.967689ms: Resolved a new service: FritzBoxRepeater._fbox._tcp.local.
host: FritzBoxRepeater.fritz.box.
port: 49000
Address: 2003:e8:bf1e:9b00:ca0e:14ff:feff:416
Address: fd00::ca0e:14ff:feff:416
Address: 192.168.178.89
Address: fe80::ca0e:14ff:feff:416%enp12s0

@hrzlgnm
Copy link
Contributor Author

hrzlgnm commented Jan 21, 2026

Ah this won't work without updating rust to 1.84.0, perhaps something to be done when bumping the MSRV to 1.84

@hrzlgnm hrzlgnm marked this pull request as draft January 21, 2026 23:30
@keepsimple1
Copy link
Owner

Ah this won't work without updating rust to 1.84.0, perhaps something to be done when bumping the MSRV to 1.84

Can you use this helper we already have:

mdns-sd/src/service_info.rs

Lines 1232 to 1237 in 3f34136

/// Returns true if `addr` is a unicast link-local IPv6 address.
/// Replicates the logic from `std::net::Ipv6Addr::is_unicast_link_local()`, which is not
/// stable on the current mdns-sd Rust version (1.71.0).
///
/// https://github.com/rust-lang/rust/blob/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/core/src/net/ip_addr.rs#L1684
fn is_unicast_link_local(addr: &Ipv6Addr) -> bool {

@hrzlgnm
Copy link
Contributor Author

hrzlgnm commented Jan 26, 2026

Ah this won't work without updating rust to 1.84.0, perhaps something to be done when bumping the MSRV to 1.84

Can you use this helper we already have:

mdns-sd/src/service_info.rs

Lines 1232 to 1237 in 3f34136

/// Returns true if `addr` is a unicast link-local IPv6 address.
/// Replicates the logic from `std::net::Ipv6Addr::is_unicast_link_local()`, which is not
/// stable on the current mdns-sd Rust version (1.71.0).
///
/// https://github.com/rust-lang/rust/blob/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/core/src/net/ip_addr.rs#L1684
fn is_unicast_link_local(addr: &Ipv6Addr) -> bool {

Thanks for pointing it out, I totally forgot about that helper.

@hrzlgnm hrzlgnm force-pushed the fix/display-of-scoped-ip branch from 2344939 to d2be824 Compare January 26, 2026 08:12
@hrzlgnm hrzlgnm force-pushed the fix/display-of-scoped-ip branch from d2be824 to 14ff36e Compare January 26, 2026 08:14
@hrzlgnm hrzlgnm marked this pull request as ready for review January 26, 2026 08:15
Copy link
Owner

@keepsimple1 keepsimple1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@keepsimple1 keepsimple1 merged commit 58c15b4 into keepsimple1:main Jan 27, 2026
3 checks passed
@hrzlgnm hrzlgnm deleted the fix/display-of-scoped-ip branch January 27, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants