Repository navigation
fix: don't leave the IPv4 mDNS group by a vanished address - #543
Merged
keepsimple1 merged 3 commits intoNov 22, 2026
Merged
Conversation
On macOS, leaving the group by an address the host no longer has drops the socket's first membership instead, cutting off another interface. Skip the leave then; the membership is gone or still valid anyway.
Owner
|
Thanks for your PR! Will review it tomorrow. |
keepsimple1
reviewed
Nov 10, 2026
Linux matches a leave by the address the membership was joined with, even once that address is gone, and needs it: it keeps the memberships of removed interfaces, and they count toward igmp_max_memberships. So the skip now applies only on Apple platforms, and the leave goes ahead elsewhere. Also skip the leave on every platform when the address is now on another interface, as the kernel would drop that interface's membership instead. The check uses the callers' snapshot of the host's addresses instead of calling get_if_addrs() on every leave.
…hed-addr Pass the address snapshot to the new del_interface_addr() call in test_running_state_reports_join_per_ip_version, added on main by keepsimple1#524.
Owner
|
I've made minor edits and merged the PR. Thanks again for your initial PR! |
keepsimple1
approved these changes
Nov 22, 2026
This was referenced Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
The daemon leaves the IPv4 mDNS group by interface address. By the time the IP check notices an interface is gone its address is often already gone from the host. macOS then drops the socket's first membership of the group instead of the intended one, so another interface silently stops receiving mDNS multicast. Other systems just fail the call.
Fix:
leave_multicast_v4()leaves the group only if the host still has theaddress, and both leave paths (
check_ip_changes()anddel_interface_addr()) go through it. Skipping the leave loses nothing: aremoved interface takes its membership with it, and one that only changed
its address keeps it, which the next join treats as already held.
Covered by
test_leaving_a_vanished_address_keeps_other_memberships, which fails on macOS without the fix.