From 6f11eb2bb0da391efa7d8df8a1aac99074590654 Mon Sep 17 00:00:00 2001 From: Matthew R Kasun Date: Tue, 30 May 2023 23:40:05 -0400 Subject: [PATCH] update version/firewall in use if changed on checkin (#2335) --- mq/handlers.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mq/handlers.go b/mq/handlers.go index 24cc349c..89cb1c0d 100644 --- a/mq/handlers.go +++ b/mq/handlers.go @@ -428,6 +428,15 @@ func handleHostCheckin(h, currentHost *models.Host) bool { for i := range h.Interfaces { h.Interfaces[i].AddressString = h.Interfaces[i].Address.String() } + /// version or firewall in use change does not require a peerUpdate + if h.Version != currentHost.Version || h.FirewallInUse != currentHost.FirewallInUse { + currentHost.FirewallInUse = h.FirewallInUse + currentHost.Version = h.Version + if err := logic.UpsertHost(currentHost); err != nil { + logger.Log(0, "failed to update host after check-in", h.Name, h.ID.String(), err.Error()) + return false + } + } ifaceDelta := len(h.Interfaces) != len(currentHost.Interfaces) || !h.EndpointIP.Equal(currentHost.EndpointIP) || (len(h.NatType) > 0 && h.NatType != currentHost.NatType) ||