From b0582c86ba86fe120e8e1986332bbe41b8930c02 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Sat, 28 Jun 2025 17:59:35 +0200 Subject: [PATCH] update config if exist --- management/server/update_buffer.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/management/server/update_buffer.go b/management/server/update_buffer.go index 087341678..6ad71af88 100644 --- a/management/server/update_buffer.go +++ b/management/server/update_buffer.go @@ -25,6 +25,24 @@ func (b *UpdateBuffer) Push(update *UpdateMessage) { b.mu.Lock() defer b.mu.Unlock() + if b.update != nil && update.Update.NetbirdConfig != nil { + if update.Update.NetbirdConfig.Relay != nil { + b.update.Update.NetbirdConfig.Relay = update.Update.NetbirdConfig.Relay + } + if update.Update.NetbirdConfig.Signal != nil { + b.update.Update.NetbirdConfig.Signal = update.Update.NetbirdConfig.Signal + } + if update.Update.NetbirdConfig.Flow != nil { + b.update.Update.NetbirdConfig.Flow = update.Update.NetbirdConfig.Flow + } + if update.Update.NetbirdConfig.Stuns != nil { + b.update.Update.NetbirdConfig.Stuns = update.Update.NetbirdConfig.Stuns + } + if update.Update.NetbirdConfig.Turns != nil { + b.update.Update.NetbirdConfig.Turns = update.Update.NetbirdConfig.Turns + } + } + // the equal case we need because we don't always increment the serial number if b.update == nil || update.Update.NetworkMap.Serial > b.update.Update.NetworkMap.Serial || b.update.Update.NetworkMap.Serial == 0 { b.update = update