diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-23 02:10:54 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-23 03:58:27 +0200 |
commit | 0a63188afab1dd49380f916963307f9b2efdcac1 (patch) | |
tree | 37dac3b29a2f89a99e1df1cafd1cbbc2a0e803f0 /main.go | |
parent | 65a74f3175855dc41b49332103ada6bb27733291 (diff) |
Move tun to subpackage
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -7,6 +7,7 @@ package main import ( + "./tun" "fmt" "os" "os/signal" @@ -125,10 +126,10 @@ func main() { // open TUN device (or use supplied fd) - tun, err := func() (TUNDevice, error) { + tun, err := func() (tun.TUNDevice, error) { tunFdStr := os.Getenv(ENV_WG_TUN_FD) if tunFdStr == "" { - return CreateTUN(interfaceName) + return tun.CreateTUN(interfaceName, DefaultMTU) } // construct tun device from supplied fd @@ -139,7 +140,7 @@ func main() { } file := os.NewFile(uintptr(fd), "") - return CreateTUNFromFile(file) + return tun.CreateTUNFromFile(file, DefaultMTU) }() if err == nil { |