freebind

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package freebind provides a net.ListenConfig.Control hook that sets the Linux IP_FREEBIND (and IPV6_FREEBIND) socket option, allowing listeners to bind to IP addresses that are not yet assigned to a network interface.

Index

Constants

View Source
const Supported = true

Supported reports whether the freebind Control hook has an effect on this platform. It is true on Linux.

Variables

This section is empty.

Functions

func Control

func Control(network, address string, c syscall.RawConn) error

Control is a net.ListenConfig.Control function that enables binding to not-yet-available addresses by setting IP_FREEBIND (IPv4) and IPV6_FREEBIND (IPv6) on the socket.

Both options are attempted; depending on the socket's address family one of them returns ENOPROTOOPT, which is expected. The call only fails if neither option could be set.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL