Skip to content

Commit 02afd4e

Browse files
committed
Move to networkMap.PeerConfig
1 parent d19f829 commit 02afd4e

File tree

5 files changed

+68
-67
lines changed

5 files changed

+68
-67
lines changed

client/internal/engine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ func (e *Engine) handleSync(update *mgmProto.SyncResponse) error {
718718
e.syncMsgMux.Lock()
719719
defer e.syncMsgMux.Unlock()
720720

721-
if update.NetworkMap != nil {
722-
e.handleAutoUpdateVersion(update.NetworkMap.AutoUpdateVersion)
721+
if update.NetworkMap != nil && update.NetworkMap.PeerConfig != nil {
722+
e.handleAutoUpdateVersion(update.NetworkMap.PeerConfig.AutoUpdateVersion)
723723
}
724724
if update.GetNetbirdConfig() != nil {
725725
wCfg := update.GetNetbirdConfig()

management/server/grpcserver.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,17 +710,18 @@ func toPeerConfig(peer *nbpeer.Peer, network *types.Network, dnsName string, set
710710
Fqdn: fqdn,
711711
RoutingPeerDnsResolutionEnabled: settings.RoutingPeerDNSResolutionEnabled,
712712
LazyConnectionEnabled: settings.LazyConnectionEnabled,
713+
AutoUpdateVersion: settings.AutoUpdateVersion,
713714
}
714715
}
715716

716717
func toSyncResponse(ctx context.Context, config *nbconfig.Config, peer *nbpeer.Peer, turnCredentials *Token, relayCredentials *Token, networkMap *types.NetworkMap, dnsName string, checks []*posture.Checks, dnsCache *DNSConfigCache, settings *types.Settings, extraSettings *types.ExtraSettings, peerGroups []string) *proto.SyncResponse {
717718
response := &proto.SyncResponse{
718719
PeerConfig: toPeerConfig(peer, networkMap.Network, dnsName, settings),
719720
NetworkMap: &proto.NetworkMap{
720-
Serial: networkMap.Network.CurrentSerial(),
721-
Routes: toProtocolRoutes(networkMap.Routes),
722-
DNSConfig: toProtocolDNSConfig(networkMap.DNSConfig, dnsCache),
723-
AutoUpdateVersion: settings.AutoUpdateVersion,
721+
Serial: networkMap.Network.CurrentSerial(),
722+
Routes: toProtocolRoutes(networkMap.Routes),
723+
DNSConfig: toProtocolDNSConfig(networkMap.DNSConfig, dnsCache),
724+
PeerConfig: toPeerConfig(peer, networkMap.Network, dnsName, settings),
724725
},
725726
Checks: toProtocolChecks(ctx, checks),
726727
}

management/server/peer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ func deletePeers(ctx context.Context, am *DefaultAccountManager, transaction sto
15541554
RemotePeersIsEmpty: true,
15551555
FirewallRules: []*proto.FirewallRule{},
15561556
FirewallRulesIsEmpty: true,
1557-
AutoUpdateVersion: settings.AutoUpdateVersion,
1557+
PeerConfig: toPeerConfig(peer, network, dnsDomain, settings),
15581558
},
15591559
},
15601560
NetworkMap: &types.NetworkMap{},

shared/management/proto/management.pb.go

Lines changed: 57 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shared/management/proto/management.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ message PeerConfig {
266266
bool LazyConnectionEnabled = 6;
267267

268268
int32 mtu = 7;
269+
270+
// Auto-update config
271+
string autoUpdateVersion = 8;
269272
}
270273

271274
// NetworkMap represents a network state of the peer with the corresponding configuration parameters to establish peer-to-peer connections
@@ -306,9 +309,6 @@ message NetworkMap {
306309
bool routesFirewallRulesIsEmpty = 11;
307310

308311
repeated ForwardingRule forwardingRules = 12;
309-
310-
// Auto-update config
311-
string autoUpdateVersion = 13;
312312
}
313313

314314
// RemotePeerConfig represents a configuration of a remote peer.

0 commit comments

Comments
 (0)