From eca2bc860abefa580c32f6452bc6598799106db6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 14 Sep 2021 12:23:07 +0200 Subject: tunnel: reinitialize configuration after PnP flaps driver on <10 On older Windows, PnP will unload the driver and reload it. This makes multiple tunnels impossible, as we knew. But this also happens when various adapter settings change, like ICS, which is maybe a bigger issue. Solve this by reloading the configuration after these flaps. Reported-by: Harland Coles Signed-off-by: Jason A. Donenfeld --- tunnel/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tunnel/service.go') diff --git a/tunnel/service.go b/tunnel/service.go index 9df4fecc..decfb571 100644 --- a/tunnel/service.go +++ b/tunnel/service.go @@ -276,7 +276,7 @@ func (service *tunnelService) Execute(args []string, r <-chan svc.ChangeRequest, var clamper mtuClamper clamper = nativeTun - watcher.Configure(bind.(conn.BindSocketToInterface), clamper, config, luid) + watcher.Configure(bind.(conn.BindSocketToInterface), clamper, nil, config, luid) log.Println("Listening for UAPI requests") go func() { @@ -298,7 +298,7 @@ func (service *tunnelService) Execute(args []string, r <-chan svc.ChangeRequest, if err != nil { serviceError = services.ErrorDeviceBringUp } - watcher.Configure(nil, nil, config, luid) + watcher.Configure(nil, nil, adapter, config, luid) } err = runScriptCommand(config.Interface.PostUp, config.Name) -- cgit v1.2.3-59-g8ed1b