From 245b086646b1c52a17562b4f731fcea6cd6b6f00 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Fri, 14 Jun 2024 14:22:49 +0200 Subject: [PATCH] fix network monitor ref check (#2133) --- client/internal/connect.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/internal/connect.go b/client/internal/connect.go index c83a5622b..1cfabe910 100644 --- a/client/internal/connect.go +++ b/client/internal/connect.go @@ -309,6 +309,10 @@ func (c *ConnectClient) Engine() *Engine { // createEngineConfig converts configuration received from Management Service to EngineConfig func createEngineConfig(key wgtypes.Key, config *Config, peerConfig *mgmProto.PeerConfig) (*EngineConfig, error) { + nm := false + if config.NetworkMonitor != nil { + nm = *config.NetworkMonitor + } engineConf := &EngineConfig{ WgIfaceName: config.WgIface, WgAddr: peerConfig.Address, @@ -316,7 +320,7 @@ func createEngineConfig(key wgtypes.Key, config *Config, peerConfig *mgmProto.Pe DisableIPv6Discovery: config.DisableIPv6Discovery, WgPrivateKey: key, WgPort: config.WgPort, - NetworkMonitor: *config.NetworkMonitor, + NetworkMonitor: nm, SSHKey: []byte(config.SSHKey), NATExternalIPs: config.NATExternalIPs, CustomDNSAddress: config.CustomDNSAddress,