mirror of
https://github.com/fosrl/olm.git
synced 2026-02-08 05:56:41 +00:00
testing
This commit is contained in:
@@ -16,10 +16,6 @@ import (
|
||||
|
||||
// ConfigureInterface configures a network interface with an IP address and brings it up
|
||||
func ConfigureInterface(interfaceName string, wgData WgData) error {
|
||||
if interfaceName == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
var ipAddr string = wgData.TunnelIP
|
||||
|
||||
// Parse the IP address and network
|
||||
|
||||
11
olm/unix.go
11
olm/unix.go
@@ -18,12 +18,21 @@ func createTUNFromFD(tunFd uint32, mtuInt int) (tun.Device, error) {
|
||||
logger.Error("Unable to dup tun fd: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = unix.SetNonblock(dupTunFd, true)
|
||||
if err != nil {
|
||||
unix.Close(dupTunFd)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return tun.CreateTUNFromFile(os.NewFile(uintptr(dupTunFd), "/dev/tun"), mtuInt)
|
||||
file := os.NewFile(uintptr(dupTunFd), "/dev/tun")
|
||||
device, err := tun.CreateTUNFromFile(file, mtuInt)
|
||||
if err != nil {
|
||||
file.Close()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return device, nil
|
||||
}
|
||||
|
||||
func uapiOpen(interfaceName string) (*os.File, error) {
|
||||
|
||||
Reference in New Issue
Block a user