{"record":{"id":"a0c64f8f21782079","repo":"slackhq/nebula","slug":"unexpected-packetconn-t-v","errorCode":null,"errorMessage":"unexpected PacketConn: %T %#v","messagePattern":"unexpected PacketConn: %T %#v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"udp/udp_darwin.go","lineNumber":61,"sourceCode":"\t\t}\n\n\t\terr = rc.Control(func(fd uintptr) {\n\t\t\tc.sysFd = fd\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get udp fd: %w\", err)\n\t\t}\n\n\t\tla, err := c.LocalAddr()\n\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","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/udp/udp_darwin.go#L43-L79","documentation":"Type-guard failure at the end of the Darwin NewListener: ListenPacket returned something that is not a *net.UDPConn (its concrete type and value are printed). Practically unreachable with the \"udp\" network string; if hit, it means an unexpected netpoll wrapper was returned.","triggerScenarios":"Thrown at udp/udp_darwin.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is a defensive assertion: on macOS the listener first tries to obtain a udp_sock via Control-based fd extraction from a *net.UDPConn and returns early; reaching this error means the ListenPacket-based fallback returned a PacketConn that is neither a udp_sock nor a *net.UDPConn","Check which nebula UDP path is active on this Darwin build; a non-standard build tag or stubbed network stack can produce an unexpected PacketConn concrete type","Update Go and nebula: changes in net package behavior across Go versions can alter the concrete type returned by ListenPacket","If reproducible, file a nebula issue with the %T/%#v detail printed in the error — it names the unexpected concrete type"],"exampleFix":null,"handlingStrategy":"type-guard","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"}