{"record":{"id":"816927669e1c1554","repo":"slackhq/nebula","slug":"so-reuseport-failed-v-816927","errorCode":null,"errorMessage":"SO_REUSEPORT failed: %v","messagePattern":"SO_REUSEPORT failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"udp/udp_darwin.go","lineNumber":71,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tc.isV4 = la.Addr().Is4()\n\n\t\treturn c, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"unexpected PacketConn: %T %#v\", pc, pc)\n}\n\nfunc NewListenConfig(multi bool) net.ListenConfig {\n\treturn net.ListenConfig{\n\t\tControl: func(network, address string, c syscall.RawConn) error {\n\t\t\tif multi {\n\t\t\t\tvar controlErr error\n\t\t\t\terr := c.Control(func(fd uintptr) {\n\t\t\t\t\tif err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil {\n\t\t\t\t\t\tcontrolErr = fmt.Errorf(\"SO_REUSEPORT failed: %v\", err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif controlErr != nil {\n\t\t\t\t\treturn controlErr\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n}\n\n//go:linkname sendto golang.org/x/sys/unix.sendto\n//go:noescape","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/udp/udp_darwin.go#L53-L89","documentation":"Error inside the Darwin ListenConfig Control callback: SetsockoptInt failed while enabling SO_REUSEPORT on the UDP socket. The kernel refused the option (e.g. unsupported), and the error from inside c.Control is surfaced, failing listener creation when multi is requested.","triggerScenarios":"Thrown at udp/udp_darwin.go:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disable multi-listener mode so SO_REUSEPORT is not set","Verify macOS/kernel support for SO_REUSEPORT on UDP","Inspect the errno in the message for the exact refusal"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}