Skip to content

socket.has_dualstack_ipv6() incorrectly returns True on DragonFly BSD #154291

Description

@serhiy-storchaka

On DragonFly BSD, socket.has_dualstack_ipv6() returns True, but dualstack sockets do not actually work: setsockopt(IPPROTO_IPV6, IPV6_V6ONLY, 0) succeeds silently without clearing the flag, so the socket stays IPv6-only and an IPv4 client connection is refused.

has_dualstack_ipv6() only checks that setsockopt does not raise, so it does not detect this. It should verify with getsockopt that IPV6_V6ONLY was actually cleared.

This makes test_socket.test_dual_stack_client_v4 fail on DragonFly with ConnectionRefusedError.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixestestsTests in the Lib/test dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions