]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/cypherpunks.ru/govpn/tap_linux.go
upgrade water to original maintained repository
[govpn.git] / src / cypherpunks.ru / govpn / tap_linux.go
index fb9df56437b80829340e007b7ec02421dd750148..2f901eb773a3286a840f4e2ad03095c0cd1f2a21 100644 (file)
@@ -2,17 +2,22 @@
 
 /*
 GoVPN -- simple secure free software virtual private network daemon
-Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2017 Sergey Matveev <stargrave@stargrave.org>
 */
 
 package govpn
 
 import (
        "io"
+       "strings"
 
-       "github.com/bigeagle/water"
+       "github.com/songgao/water"
 )
 
 func newTAPer(ifaceName string) (io.ReadWriter, error) {
-       return water.NewTAP(ifaceName)
+       if strings.HasPrefix(ifaceName, "tap") {
+               return water.NewTAP(ifaceName)
+       } else {
+               return water.NewTUN(ifaceName)
+       }
 }