rpc: disable mDNS when force_relay or force_p2p is set#183
Closed
danielbotros wants to merge 1 commit into
Closed
Conversation
force_relay/force_p2p force a connection through a specific WebRTC transport, but the dialer attempts mDNS local discovery first and will connect via plain gRPC over LAN/loopback when the target is locally reachable, bypassing WebRTC/ICE and silently ignoring the flag. Disable mDNS in both builders so the FFI (and all consumers) get correct behavior.
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
force_relay/force_p2pexist to force a connection through a specific WebRTC transport (relay-only TURN, or host/srflx-only). But the dialer attempts mDNS local discovery first, and when the target machine is reachable on the LAN/loopback it connects via plain gRPC over mDNS — bypassing WebRTC/ICE entirely and silently ignoringforce_relay/force_p2p.Observed in the SDK dial-options integration tests against the Python SDK (which dials via these FFI bindings): a
force_relayconnection that should route through TURN instead connected locally over mDNS (no relaycandidate_pairever appears), and aforce_relayconnection with a deliberately-invalid TURN URI (which must fail) succeeded over mDNS.RUST_LOG=debugshowedStarting mDNS query→Found address via mDNS→mDNS create_channel: loopback 127.0.0.1with no TURN allocation.Fix
Disable mDNS in the
force_relay()andforce_p2p()builders. Since the FFI (viam_dial_opts_set_force_relay/viam_dial_opts_set_force_p2p) routes through these builders, Python/C consumers pick this up automatically (aviam-python-sdkbundled-rust-utils bump is the follow-up to ship it). Mirrors the Go dialer behavior.Draft for review/discussion.