MCPcopy
hub / github.com/istio/istio / reuseAddr

Function reuseAddr

tools/istio-iptables/pkg/validation/vld_unix.go:95–106  ·  view source on GitHub ↗

Setup reuse address to run the validation server more robustly

(network, address string, conn syscall.RawConn)

Source from the content-addressed store, hash-verified

93
94// Setup reuse address to run the validation server more robustly
95func reuseAddr(network, address string, conn syscall.RawConn) error {
96 return conn.Control(func(descriptor uintptr) {
97 err := unix.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, unix.SO_REUSEADDR, 1)
98 if err != nil {
99 log.Errorf("Fail to set fd %d SO_REUSEADDR with error %v", descriptor, err)
100 }
101 err = unix.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1)
102 if err != nil {
103 log.Errorf("Fail to set fd %d SO_REUSEPORT with error %v", descriptor, err)
104 }
105 })
106}

Callers

nothing calls this directly

Calls 1

ErrorfFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…