X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Ftap_linux.go;h=388853d817e58ef2d2726fff707636a4828d4b00;hb=572cac17bde738055312f7a468a0bde0e760a262;hp=fb9df56437b80829340e007b7ec02421dd750148;hpb=a87ec543051d428aaa3888804d6c8451f6d537c9;p=govpn.git diff --git a/src/cypherpunks.ru/govpn/tap_linux.go b/src/cypherpunks.ru/govpn/tap_linux.go index fb9df56..388853d 100644 --- a/src/cypherpunks.ru/govpn/tap_linux.go +++ b/src/cypherpunks.ru/govpn/tap_linux.go @@ -2,17 +2,22 @@ /* GoVPN -- simple secure free software virtual private network daemon -Copyright (C) 2014-2016 Sergey Matveev +Copyright (C) 2014-2017 Sergey Matveev */ package govpn import ( "io" + "strings" "github.com/bigeagle/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) + } }