From e4829832c509f13f45f13f5bb0ef2131394b49bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Serv=C3=A9n=20Mar=C3=ADn?= Date: Thu, 30 Apr 2020 13:53:38 +0200 Subject: [PATCH] pkg/mesh: ensure persistent-keepalive set on nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A bug identified by @carlosrmendes caused nodes to ignore the persistent-keepalive annotation. xref: https://github.com/squat/kilo/issues/53#issuecomment-620945927 Signed-off-by: Lucas Servén Marín --- pkg/mesh/mesh.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkg/mesh/mesh.go b/pkg/mesh/mesh.go index 5a9fbef..0def391 100644 --- a/pkg/mesh/mesh.go +++ b/pkg/mesh/mesh.go @@ -478,15 +478,16 @@ func (m *Mesh) handleLocal(n *Node) { // Take leader, location, and subnet from the argument, as these // are not determined by kilo. local := &Node{ - Endpoint: n.Endpoint, - Key: m.pub, - InternalIP: n.InternalIP, - LastSeen: time.Now().Unix(), - Leader: n.Leader, - Location: n.Location, - Name: m.hostname, - Subnet: n.Subnet, - WireGuardIP: m.wireGuardIP, + Endpoint: n.Endpoint, + Key: m.pub, + InternalIP: n.InternalIP, + LastSeen: time.Now().Unix(), + Leader: n.Leader, + Location: n.Location, + Name: m.hostname, + PersistentKeepalive: n.PersistentKeepalive, + Subnet: n.Subnet, + WireGuardIP: m.wireGuardIP, } if !nodesAreEqual(n, local) { level.Debug(m.logger).Log("msg", "local node differs from backend")