XTLS/Xray-core · error
interface name must be utunN, where N is a number, e.g. utun
Error message
interface name must be utunN, where N is a number, e.g. utun9, utun11 and so on
What it means
Error "interface name must be utunN, where N is a number, e.g. utun9, utun11 and so on" thrown in XTLS/Xray-core.
Source
Thrown at proxy/tun/tun_darwin.go:259
},
}), nil
}
// Wait some cpu cycles
func (t *DarwinTun) Wait() {
procyield(1)
}
func (t *DarwinTun) newEndpoint() (stack.LinkEndpoint, error) {
return &LinkEndpoint{deviceMTU: t.options.MTU, device: t}, nil
}
// open the interface, by creating new utunN if in the system and returning its file descriptor
func open(name string) (*os.File, error) {
ifIndex := -1
_, err := fmt.Sscanf(name, "utun%d", &ifIndex)
if err != nil || ifIndex < 0 {
return nil, errors.New("interface name must be utunN, where N is a number, e.g. utun9, utun11 and so on")
}
fd, err := unix.Socket(unix.AF_SYSTEM, unix.SOCK_DGRAM, sysprotoControl)
if err != nil {
return nil, err
}
ctlInfo := &unix.CtlInfo{}
copy(ctlInfo.Name[:], utunControlName)
if err := unix.IoctlCtlInfo(fd, ctlInfo); err != nil {
_ = unix.Close(fd)
return nil, err
}
sockaddr := &unix.SockaddrCtl{
ID: ctlInfo.Id,
Unit: uint32(ifIndex) + 1,
}View on GitHub (pinned to 7d214f8b09)
When it happens
Trigger: Thrown at proxy/tun/tun_darwin.go:259 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/24e92164a9dfe1ab.
Report an issue: GitHub.