Skip to content

discovery: allow limiting the advertised ip addresses - #1425

Open
Hayao0819 wants to merge 1 commit into
Spotifyd:masterfrom
Hayao0819:zeroconf-ip
Open

discovery: allow limiting the advertised ip addresses#1425
Hayao0819 wants to merge 1 commit into
Spotifyd:masterfrom
Hayao0819:zeroconf-ip

Conversation

@Hayao0819

Copy link
Copy Markdown

The mDNS responder advertises an A record for every interface, because spotifyd never fills in the zeroconf_ip list that librespot's builder has been offering all along: Builder::zeroconf_ip.

On a box with docker, tailscale and a dozen emulator taps, clients pick whichever record they like. Mine kept landing on a 192.168.94.x tap address that nothing on the LAN can reach.

--zeroconf-ip 10.0.0.5 / zeroconf_ip = ["10.0.0.5"] limits what goes out. Plumbed the same way as zeroconf_port.

#990 asked for this back in 2021 and stalled on the conclusion that librespot was in the way, "Zeroconf discovery is hardcoded to bind to 0.0.0.0", with a later comment: "I would like to use a specific bind ip. With multiple IP addresses on one machine, this is a critical need." That was accurate then. The builder method exists now and nothing on our side was calling it. #1285 is the adjacent report, where a second IPv4 on one interface breaks discovery and removing it brings the device back.

This closes neither of them. libmdns applies the list when it builds answer records and nowhere else: fsm.rs#L244. The socket still binds ANY_ADDR and still joins the multicast group on every non-loopback interface: address_family.rs#L26. The discovery TCP listener is untouched. The bind half of #990 and the failure in #1285 both stay open.

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.

1 participant