{"record":{"id":"24e92164a9dfe1ab","repo":"XTLS/Xray-core","slug":"interface-name-must-be-utunn-where-n-is-a-number","errorCode":null,"errorMessage":"interface name must be utunN, where N is a number, e.g. utun9, utun11 and so on","messagePattern":"interface name must be utunN, where N is a number, e\\.g\\. utun9, utun11 and so on","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/tun/tun_darwin.go","lineNumber":259,"sourceCode":"\t\t},\n\t}), nil\n}\n\n// Wait some cpu cycles\nfunc (t *DarwinTun) Wait() {\n\tprocyield(1)\n}\n\nfunc (t *DarwinTun) newEndpoint() (stack.LinkEndpoint, error) {\n\treturn &LinkEndpoint{deviceMTU: t.options.MTU, device: t}, nil\n}\n\n// open the interface, by creating new utunN if in the system and returning its file descriptor\nfunc open(name string) (*os.File, error) {\n\tifIndex := -1\n\t_, err := fmt.Sscanf(name, \"utun%d\", &ifIndex)\n\tif err != nil || ifIndex < 0 {\n\t\treturn nil, errors.New(\"interface name must be utunN, where N is a number, e.g. utun9, utun11 and so on\")\n\t}\n\n\tfd, err := unix.Socket(unix.AF_SYSTEM, unix.SOCK_DGRAM, sysprotoControl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctlInfo := &unix.CtlInfo{}\n\tcopy(ctlInfo.Name[:], utunControlName)\n\tif err := unix.IoctlCtlInfo(fd, ctlInfo); err != nil {\n\t\t_ = unix.Close(fd)\n\t\treturn nil, err\n\t}\n\n\tsockaddr := &unix.SockaddrCtl{\n\t\tID:   ctlInfo.Id,\n\t\tUnit: uint32(ifIndex) + 1,\n\t}","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/tun/tun_darwin.go#L241-L277","documentation":"Error \"interface name must be utunN, where N is a number, e.g. utun9, utun11 and so on\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/tun/tun_darwin.go:259 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}