Skip to content

quiche with a pinned source port can dial only a broken IPv4 address #2853

Closed

Description

@kixelated

Problem

rs/moq-native/src/quiche.rs truncates its candidate list to one address when --connect-bind pins a non-zero source port, because a pinned port only fits one socket at a time:

if self.bind.port() != 0 {
    candidates = candidates.with_limit(1);
}

Since #2749, that single candidate can come from the speculative IPv4-only lookup rather than the authoritative all-family answer. Candidates::next already mitigates this per RFC 8305 section 3: for the first candidate it holds an IPv4-only answer back and waits up to --connect-resolution-delay (50ms) for the full lookup, so the platform's own RFC 6724 ranking usually wins.

That bounds the window rather than closing it. If AAAA is more than the resolution delay slower than A, the wait times out and the IPv4 address is taken. With limit(1) there is no second attempt, so a host whose IPv4 path is broken and whose IPv6 path works now fails to connect, where before #2749 the dial waited for the complete resolver result and took its first (IPv6) address.

Narrow by construction: it needs the quiche backend, a pinned non-zero --connect-bind port, a slow AAAA, and a broken IPv4 path. Every other backend races both families, so limit(1) is the only place a preference becomes an exclusion.

Suggested direction

For the limit(1) path specifically, wait for the authoritative answer rather than accepting the fast lane: the fast lane exists to start dialing sooner, which is worth nothing when only one attempt will ever be made.

Found while reviewing #2852 (merging main into dev); the code is identical on main, so this is not a merge regression and was left out of that PR. Originally raised by the Codex connector bot as an inline comment there.

(written by Opus 5)

Activity

  1. coderabbitai commented on Aug 14, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #1806 - fix(moq-native): back off when a session flaps instead of busy-looping [merged]
    #1878 - Skip dual-stack bind tests when the host lacks IPv6 [merged]
    #2327 - fix(moq-rtc): handle IPv4-mapped peers on a dual-stack socket [merged]
    #2594 - feat(native): race resolved addresses Happy Eyeballs style when dialing [merged]
    #2749 - feat(native): start dialing before the AAAA answer lands [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    questBeing tracked/planned in a quest. See `quest/`
    on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questBeing tracked/planned in a quest. See `quest/`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions