Working single channel bind

This commit is contained in:
braginini
2022-09-05 02:03:16 +02:00
parent f5e974c04c
commit 2ae4c204af
10 changed files with 224 additions and 220 deletions

View File

@@ -2,8 +2,8 @@ package iface
import (
"errors"
"golang.zx2c4.com/wireguard/conn"
"math"
"net"
"os"
"syscall"
@@ -33,11 +33,11 @@ func WireguardModExists() bool {
return errors.Is(err, syscall.EINVAL)
}
func (w *WGIface) CreateNew(sharedSock *net.UDPConn) error {
func (w *WGIface) CreateNew(bind conn.Bind) error {
w.mu.Lock()
defer w.mu.Unlock()
return w.createWithUserspaceNew(sharedSock)
return w.createWithUserspaceNew(bind)
}
// Create creates a new Wireguard interface, sets a given IP and brings it up.