From ba12ba5bec08870e08d58d90deb46ef08b187e6d Mon Sep 17 00:00:00 2001 From: riccardom Date: Thu, 11 Jun 2026 12:42:57 +0200 Subject: [PATCH] DisableAutoConnect should not stop a running connection. DisableAutoConnect should just avoid the connection attempts *when the service starts*. If we are started and we are up and running, DisableAutoConnect should not kick in. Another PR will follow about this topic --- client/server/mdm.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/client/server/mdm.go b/client/server/mdm.go index ad565e0e0..e4b71596c 100644 --- a/client/server/mdm.go +++ b/client/server/mdm.go @@ -10,7 +10,6 @@ import ( "google.golang.org/grpc/codes" gstatus "google.golang.org/grpc/status" - "github.com/netbirdio/netbird/client/internal" "github.com/netbirdio/netbird/client/mdm" "github.com/netbirdio/netbird/client/proto" ) @@ -144,14 +143,6 @@ func (s *Server) restartEngineForMDMLocked() error { s.statusRecorder.UpdateRosenpass(config.RosenpassEnabled, config.RosenpassPermissive) s.statusRecorder.UpdateLazyConnection(config.LazyConnectionEnabled) - state := internal.CtxGetState(s.rootCtx) - if config.DisableAutoConnect { - log.Info("MDM restart: DisableAutoConnect=true; staying idle") - state.Set(internal.StatusIdle) - s.actCancel = nil - return nil - } - ctx, cancel := context.WithCancel(s.rootCtx) s.actCancel = cancel s.clientRunning = true