From eb3ba2879cc68fc04f30b7be7e21cba8ebf753df Mon Sep 17 00:00:00 2001 From: Abhishek K <32607604+abhishek9686@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:24:41 +0400 Subject: [PATCH] Peerupdate bug (#2620) * update static,mtu from client side host update * update host fields if host exists already on registration * add additional logging --- controllers/hosts.go | 4 ++-- logic/peers.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/hosts.go b/controllers/hosts.go index a587db4a0..6c6bbeccb 100644 --- a/controllers/hosts.go +++ b/controllers/hosts.go @@ -100,13 +100,13 @@ func pull(w http.ResponseWriter, r *http.Request) { } allNodes, err := logic.GetAllNodes() if err != nil { - logger.Log(0, "could not pull peers for host", hostID) + logger.Log(0, "failed to get nodes: ", hostID) logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal")) return } hPU, err := logic.GetPeerUpdateForHost("", host, allNodes, nil, nil) if err != nil { - logger.Log(0, "could not pull peers for host", hostID) + logger.Log(0, "could not pull peers for host", hostID, err.Error()) logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal")) return } diff --git a/logic/peers.go b/logic/peers.go index ada95ac91..aa3475765 100644 --- a/logic/peers.go +++ b/logic/peers.go @@ -118,7 +118,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N peerHost, err := GetHost(peer.HostID.String()) if err != nil { logger.Log(1, "no peer host", peer.HostID.String(), err.Error()) - return models.HostPeerUpdate{}, err + continue } peerConfig := wgtypes.PeerConfig{ PublicKey: peerHost.PublicKey,