Browse Source

Revert ":art: Adaptations for wintun"

This reverts commit 11765a83f7ff8de67aa47ff0ceba317def92e5d7.

Revert "Add Wintun workarounds"

This reverts commit 8aa6b14c541c35dd2df9a5194bddcc184f975d16.

Cleanup for wintun
Artem Lukyanov 3 years ago
parent
commit
c1f1b423e2
3 changed files with 1 additions and 16 deletions
  1. 1 3
      go.mod
  2. 0 3
      go.sum
  3. 0 10
      pkg/vpn/interface_windows.go

+ 1 - 3
go.mod

@@ -8,10 +8,8 @@ require (
 	github.com/c-robinson/iplib v1.0.3
 	github.com/cenkalti/backoff/v4 v4.1.3
 	github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
-	github.com/fumiama/wintun v0.0.0-20211229152851-8bc97c8034c0
 	github.com/google/btree v1.1.2 // indirect
 	github.com/google/gopacket v1.1.19
-	github.com/google/uuid v1.3.0
 	github.com/hashicorp/errwrap v1.1.0 // indirect
 	github.com/hashicorp/golang-lru v0.5.4
 	github.com/huandu/xstrings v1.3.2 // indirect
@@ -43,7 +41,7 @@ require (
 	go.uber.org/zap v1.23.0
 	golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
 	golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect
-	golang.org/x/sys v0.0.0-20220829200755-d48e67d00261
+	golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect
 	gopkg.in/yaml.v2 v2.4.0
 )
 

+ 0 - 3
go.sum

@@ -157,8 +157,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
 github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
 github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
-github.com/fumiama/wintun v0.0.0-20211229152851-8bc97c8034c0 h1:WfrSFlIlCAtg6Rt2IGna0HhJYSDE45YVHiYqO4wwsEw=
-github.com/fumiama/wintun v0.0.0-20211229152851-8bc97c8034c0/go.mod h1:dPOG7Af/ArO62RgBz2JJTNFByBn/IXWLo/1kZKcLSe8=
 github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
 github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
 github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
@@ -711,7 +709,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
 github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
 github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
 github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
 github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=

+ 0 - 10
pkg/vpn/interface_windows.go

@@ -21,10 +21,7 @@ import (
 	"log"
 	"os/exec"
 
-	"github.com/fumiama/wintun"
-	"github.com/google/uuid"
 	"github.com/mudler/water"
-	"golang.org/x/sys/windows"
 )
 
 func prepareInterface(c *Config) error {
@@ -40,13 +37,6 @@ func prepareInterface(c *Config) error {
 }
 
 func createInterface(c *Config) (*water.Interface, error) {
-	// Use deterministic GUID based on interface name, so we
-	// don't flood system with Network Profiles
-	uuid, _ := uuid.FromBytes([]byte(c.InterfaceName))
-	guid, _ := windows.GUIDFromString("{" + uuid.String() + "}")
-	// Create an adapter with deterministic GUID which water will
-	// take via wintun.OpenAdapter()
-	wintun.CreateAdapter(c.InterfaceName, "WaterWintun", &guid)
 	config := water.Config{
 		DeviceType: c.DeviceType,
 	}