Skip to content

probe/hairpin: add IPv6 address-family inheritance test #24

@vnykmshr

Description

@vnykmshr

The v0.1.4 plan named an explicit IPv6 family-inheritance test for ProbeHairpinning (server resolves to IPv6 → both sockets bind on udp6/[::]:0). PR #23 ships the family-selection code path at internal/probe/hairpin.go:79-85 but the test suite only exercises IPv4 loopback (127.0.0.1).

Adding the IPv6 case requires either a localhost IPv6 STUN server (platform-sensitive — some CI environments lack ::1 UDP) or factoring the family-selection logic into a testable helper.

Scope

Pick the cheaper path:

  • Refactor: extract pickNetwork(ip netip.Addr) (network, listenAddr string) and unit-test it directly. ~10 lines.
  • Integration: build-tagged IPv6 test that skips on platforms without ::1. ~30 lines.

Either is fine. v0.1.4 polish; not release-gating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions