Peerupdate bug (#2620)

* update static,mtu from client side host update

* update host fields if host exists already on registration

* add additional logging
This commit is contained in:
Abhishek K 2023-10-11 15:24:41 +04:00 committed by GitHub
parent f4a6f1673c
commit eb3ba2879c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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
}

View file

@ -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,