From ed08eb9b3569f0e28557cf6b2e7c7fb616540bb1 Mon Sep 17 00:00:00 2001 From: fumiama Date: Wed, 29 Dec 2021 23:50:16 +0800 Subject: [PATCH] fix cid err --- params_windows.go | 3 +-- syscalls_windows.go | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/params_windows.go b/params_windows.go index 5b6c181..7cc7916 100644 --- a/params_windows.go +++ b/params_windows.go @@ -28,7 +28,6 @@ type PlatformSpecificParams struct { func defaultPlatformSpecificParams() PlatformSpecificParams { return PlatformSpecificParams{ - ComponentID: "root\\tap0901", - Network: "192.168.1.10/24", + Network: "192.168.234.0/24", } } diff --git a/syscalls_windows.go b/syscalls_windows.go index 4c6a381..15f1fc1 100644 --- a/syscalls_windows.go +++ b/syscalls_windows.go @@ -214,6 +214,9 @@ func setStatus(fd syscall.Handle, status bool) error { } func openTap(config Config) (ifce *Interface, err error) { + if config.ComponentID == "" { + config.ComponentID = "root\\tap0901" + } // find the device in registry. deviceid, err := getdeviceid(config.PlatformSpecificParams.ComponentID, config.PlatformSpecificParams.InterfaceName) if err != nil {