Repository navigation
fix(pairing): configure IPv4 multicast interfaces on multihomed hosts - #164
Open
lolinyaanyaamoe wants to merge 2 commits into
Open
lolinyaanyaamoe wants to merge 2 commits into
lolinyaanyaamoe wants to merge 2 commits into
Conversation
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Configure explicit IPv4 multicast interfaces for both the pairing mDNS publisher and resolver. This fixes invitation discovery on multihomed hosts where the peer-facing Ethernet interface is not the operating system's default multicast interface.
Reproduction and root cause
Two computers (Windows and macOS) are connected directly by Ethernet on the same IPv4 subnet, while each computer retains a separate Internet connection. Invitation-code pairing fails with either computer acting as the sponsor.
The publisher previously enumerated interface addresses for
Discoverer::with_addrs, but advertising an address does not select the multicast interfaces used to discover that advertisement. Neither pairing adapter suppliedwith_multicast_interfaces_v4, leaving discovery dependent on the default interface.Changes
MdnsInterfaceSnapshothelper, captured separately at the start of each publish/resolve operation.with_multicast_interfaces_v4on both publisher and resolver; keep the publisher's advertised addresses consistent with the same filtering policy.IpClass::Auto, existing error source chains, and default-interface behavior when interface enumeration fails. The new diagnostics record counts/error categories, not interface addresses or names.This replaces the publisher-only enumeration helper; it does not introduce a second pairing flow.
Compatibility and scope
No changes to invitation format, service name, authentication, encryption, storage, resolver timeout, relay/cloud policy, or post-pairing transport. No dependency updates.
Interface selection is a per-operation snapshot, not continuous interface monitoring. IPv6 multi-interface behavior, arbitrary VPN/WireGuard topologies, firewall restrictions, and network hot-plug are not claimed as fixed or validated.
Validation
Previously completed when this commit was prepared on the Engine revision pinned by Desktop v1.0.1 (
3f3eef7450e06013c3178b716eee9d5a3c419349, Engine v1.1.0-rc.20):This PR contains only commit
5b7d59c0073f45413bd608f1c08f71a72c4968da(six files). Subsequent local HarmonyOS bindings, multicast socket experiments, query cadence changes, and online invitation policy adaptations are intentionally excluded.