Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 20 additions and 4 deletions.
  1. +10 −2 uapi_bsd.go
  2. +10 −2 uapi_linux.go
@@ -17,8 +17,6 @@ import (
"unsafe"
)

var socketDirectory = "/var/run/wireguard"

const (
ipcErrorIO = -int64(unix.EIO)
ipcErrorProtocol = -int64(unix.EPROTO)
@@ -66,6 +64,11 @@ func (l *UAPIListener) Addr() net.Addr {

func UAPIListen(name string, file *os.File) (net.Listener, error) {

socketDirectory := os.Getenv("WG_SOCKET_DIR")
if socketDirectory == "" {
socketDirectory = "/var/run/wireguard"
}

// wrap file in listener

listener, err := net.FileListener(file)
@@ -148,6 +151,11 @@ func UAPIListen(name string, file *os.File) (net.Listener, error) {

func UAPIOpen(name string) (*os.File, error) {

socketDirectory := os.Getenv("WG_SOCKET_DIR")
if socketDirectory == "" {
socketDirectory = "/var/run/wireguard"
}

// check if path exist

err := os.MkdirAll(socketDirectory, 0755)
@@ -15,8 +15,6 @@ import (
"path"
)

var socketDirectory = "/var/run/wireguard"

const (
ipcErrorIO = -int64(unix.EIO)
ipcErrorProtocol = -int64(unix.EPROTO)
@@ -64,6 +62,11 @@ func (l *UAPIListener) Addr() net.Addr {

func UAPIListen(name string, file *os.File) (net.Listener, error) {

socketDirectory := os.Getenv("WG_SOCKET_DIR")
if socketDirectory == "" {
socketDirectory = "/var/run/wireguard"
}

// wrap file in listener

listener, err := net.FileListener(file)
@@ -145,6 +148,11 @@ func UAPIListen(name string, file *os.File) (net.Listener, error) {

func UAPIOpen(name string) (*os.File, error) {

socketDirectory := os.Getenv("WG_SOCKET_DIR")
if socketDirectory == "" {
socketDirectory = "/var/run/wireguard"
}

// check if path exist

err := os.MkdirAll(socketDirectory, 0755)

No commit comments for this range

You can’t perform that action at this time.