summaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-23 02:10:54 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-23 03:58:27 +0200
commit0a63188afab1dd49380f916963307f9b2efdcac1 (patch)
tree37dac3b29a2f89a99e1df1cafd1cbbc2a0e803f0 /main.go
parent65a74f3175855dc41b49332103ada6bb27733291 (diff)
Move tun to subpackage
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.go b/main.go
index 523a927..a04cd15 100644
--- a/main.go
+++ b/main.go
@@ -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 {