]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
device: introduce new IPC error message for unknown error
authorJosh Bleecher Snyder <josh@tailscale.com>
Mon, 25 Jan 2021 17:21:51 +0000 (09:21 -0800)
committerJosh Bleecher Snyder <josh@tailscale.com>
Mon, 25 Jan 2021 17:36:17 +0000 (09:36 -0800)
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
device/uapi.go
ipc/uapi_unix.go

index 90a9952d5eebbec908d941879dd7d6efdca65d4e..424fbfbdacb214838a93a7e1c18321a477aa9411 100644 (file)
@@ -427,8 +427,8 @@ func (device *Device) IpcHandle(socket net.Conn) {
        // write status
        var status *IPCError
        if err != nil && !errors.As(err, &status) {
-               // I/O error, maybe something unexpected
-               status = ipcErrorf(1, "other UAPI error: %w", err)
+               // shouldn't happen
+               status = ipcErrorf(ipc.IpcErrorUnknown, "other UAPI error: %w", err)
        }
        if status != nil {
                device.log.Error.Println(status)
index 510ab313d689e168f32b8c7c31bbec9678695142..9074fd9db800091ec16afb637850eec4a4cfd42d 100644 (file)
@@ -21,6 +21,7 @@ const (
        IpcErrorProtocol  = -int64(unix.EPROTO)
        IpcErrorInvalid   = -int64(unix.EINVAL)
        IpcErrorPortInUse = -int64(unix.EADDRINUSE)
+       IpcErrorUnknown   = -55 // ENOANO
 )
 
 // socketDirectory is variable because it is modified by a linker