{"record":{"id":"17c43f72ea35fbde","repo":"slackhq/nebula","slug":"unknown-address-type-v-17c43f","errorCode":null,"errorMessage":"unknown address type %v","messagePattern":"unknown address type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/tun_netbsd.go","lineNumber":300,"sourceCode":"\t\t}\n\t\treq.Lifetime = addrLifetime{\n\t\t\tVltime: 0xffffffff,\n\t\t\tPltime: 0xffffffff,\n\t\t}\n\n\t\ts, err := unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, unix.IPPROTO_IP)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer syscall.Close(s)\n\n\t\tif err := ioctl(uintptr(s), SIOCAIFADDR_IN6, uintptr(unsafe.Pointer(&req))); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to set tun address %s: %s\", cidr.Addr().String(), err)\n\t\t}\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"unknown address type %v\", cidr)\n}\n\nfunc (t *tun) Activate() error {\n\tmode := int32(unix.IFF_BROADCAST)\n\terr := ioctl(uintptr(t.fd), TUNSIFMODE, uintptr(unsafe.Pointer(&mode)))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to set tun device mode: %w\", err)\n\t}\n\n\tv := 1\n\terr = ioctl(uintptr(t.fd), TUNSIFHEAD, uintptr(unsafe.Pointer(&v)))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to set tun device head: %w\", err)\n\t}\n\n\terr = t.doIoctlByName(unix.SIOCSIFMTU, uint32(t.MTU))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to set tun mtu: %w\", err)","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/tun_netbsd.go#L282-L318","documentation":"addIp dispatches on the address family of the provided CIDR: Is4 path uses SIOCAIFADDR, Is6 path uses SIOCAIFADDR_IN6. If the address is neither recognized IPv4 nor IPv6 (or the CIDR type is unexpected), the library returns 'unknown address type %v'.","triggerScenarios":"addIp is called with a CIDR value that is neither 4- nor 6-family per the library's address type (e.g. a zero/unset address, or a mixed/uninitialized value).","commonSituations":"Config yielding an empty or malformed address that parses as an unknown family; passing a custom/foreign address type into the API.","solutions":["Check the configured tun address parses to a valid IPv4 or IPv6 CIDR","Log/inspect the %v value in the error to see what address was actually supplied","Fix config so the address is explicitly 4 or 6 (e.g. 10.0.0.1/24 or fd00::1/64)"],"exampleFix":"// before\n\"tun\": { \"dev\": \"tun0\", \"addr\": \"\" }\n// after\n\"tun\": { \"dev\": \"tun0\", \"addr\": \"10.0.0.1/24\" }","handlingStrategy":"validation","validationCode":"if !(cidr.Addr().Is4() || cidr.Addr().Is6()) {\n    return fmt.Errorf(\"unsupported tun address family: %v\", cidr)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Parse and validate the configured address at startup","Reject empty/zero addresses before reaching addIp","Log the offending value included in the error message"],"tags":["netbsd","tun","ip-address","validation"],"backgroundTag":"unknown-address-family","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"}