Documentation
¶
Overview ¶
Package kernel provides functions to interact with the kernel.
Index ¶
Constants ¶
const ( // MaxMountAttempts is the default number of retries when remounting sysfs. MaxMountAttempts = 100 // MountBackoffBase is the baseline duration between mount retry attempts. MountBackoffBase = 100 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func DisableRtFilter ¶
func DisableRtFilter() error
DisableRtFilter disables the Reverse Path Filtering on the host.
func EnableIPForwarding ¶
func EnableIPForwarding() error
EnableIPForwarding enables IP forwarding on the host. It writes 1 to /proc/sys/net/ipv4/ip_forward.
func EnableMultipathHashPolicy ¶ added in v1.2.0
func EnableMultipathHashPolicy() error
EnableMultipathHashPolicy enables 5-tuple hashing for multipath routing by writing 1 to /proc/sys/net/ipv4/fib_multipath_hash_policy.
func EnableWireguardThreadedMode ¶ added in v1.3.0
EnableWireguardThreadedMode ensures that threaded NAPI is enabled for the given WireGuard interface. It writes 1 to /sys/class/net/<ifaceName>/threaded (only if the feature is not already enabled).
func IsThreadedNAPISupported ¶ added in v1.3.0
IsThreadedNAPISupported checks if the kernel supports threaded NAPI by probing the sysfs entry for the given interface.
func RemountSysfsRO ¶ added in v1.3.0
func RemountSysfsRO()
RemountSysfsRO remounts /sys as read-only for security, retrying indefinitely until successful.
func RemountSysfsRW ¶ added in v1.3.0
func RemountSysfsRW() error
RemountSysfsRW remounts /sys as read-write, retrying up to 100 times.
Types ¶
This section is empty.