mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-29 20:39:12 +00:00
16 lines
292 B
Go
16 lines
292 B
Go
// +build linux
|
|
|
|
package loadbalancer
|
|
|
|
import (
|
|
"syscall"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func reusePort(network, address string, conn syscall.RawConn) error {
|
|
return conn.Control(func(descriptor uintptr) {
|
|
syscall.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1)
|
|
})
|
|
}
|