mirror of
https://github.com/netbirdio/netbird.git
synced 2026-03-31 06:34:14 -04:00
In netstack (proxy) mode, the process lacks permission to create /var/run/wireguard, making the UAPI listener unnecessary and causing a misleading error log. Introduce NewUSPConfigurerNoUAPI and use it for the netstack device to avoid attempting to open the UAPI socket entirely. Also consolidate UAPI error logging to a single call site.
25 lines
382 B
Go
25 lines
382 B
Go
//go:build !windows && !js
|
|
|
|
package configurer
|
|
|
|
import (
|
|
"net"
|
|
|
|
"golang.zx2c4.com/wireguard/ipc"
|
|
)
|
|
|
|
func openUAPI(deviceName string) (net.Listener, error) {
|
|
uapiSock, err := ipc.UAPIOpen(deviceName)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
listener, err := ipc.UAPIListen(deviceName, uapiSock)
|
|
if err != nil {
|
|
_ = uapiSock.Close()
|
|
return nil, err
|
|
}
|
|
|
|
return listener, nil
|
|
}
|