]> Cypherpunks.ru repositories - govpn.git/commitdiff
fix darwin build
authorBruno Clermont <bruno@robotinfra.com>
Fri, 10 Feb 2017 08:39:17 +0000 (16:39 +0800)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 3 Mar 2017 21:10:21 +0000 (00:10 +0300)
src/cypherpunks.ru/govpn/tap_darwin.go

index 2e1b67313e8734630c82f32f9009254d246e4752..766597cf8f25ffba1d183cfac097da4fb1bb8f32 100644 (file)
@@ -26,12 +26,12 @@ import (
        "github.com/songgao/water"
 )
 
-func newTAPer(ifaceName string) (io.ReadWriteCloser, error) {
-       if !strings.HasPrefix(ifaceName, interfaceTun) {
-               return nil, errors.Wrap(errUnsupportedInterface, ifaceName)
+func newTAPer(ifaceName *string) (io.ReadWriteCloser, error) {
+       if !strings.HasPrefix(*ifaceName, interfaceTun) {
+               return nil, errors.Wrap(errUnsupportedInterface, *ifaceName)
        }
-       if ifaceName != interfaceTun {
-               return nil, errors.Errorf("Darwin don't allow to set an interface name, only %q is supported", ifaceName)
+       if *ifaceName != interfaceTun {
+               return nil, errors.Errorf("Darwin don't allow to set an interface name, only %q is supported", *ifaceName)
        }
        output, err := water.New(water.Config{DeviceType: water.TUN})
        return output, errors.Wrap(err, "water.New")