Skip to content

Consider setting IPV6_V6ONLY on IPv6 sockets to prevent automatic dual-stack binding #394

@raybellis

Description

@raybellis

Using the HTTP server under Linux, the evhttp_bind_socket() function with a host parameter of :: will by default on many distributions make the socket dual-stack, meaning that a subsequent attempt to bind() to 0.0.0.0 will fail. On other O/S it's necessary to bind the IPv4 and IPv6 sockets separately.

In my evldns package I avoid this by calling setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, ...) on sockets that are about to be bound on IPv6. I understand that OpenSSH does the same.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions