From 7df19ffba3ff3686e231d874faf6c8f2936ba665 Mon Sep 17 00:00:00 2001 From: afeiszli Date: Thu, 17 Feb 2022 10:19:55 -0500 Subject: [PATCH] testing additional check on publickey --- netclient/wireguard/common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netclient/wireguard/common.go b/netclient/wireguard/common.go index 439e9437..c0337d80 100644 --- a/netclient/wireguard/common.go +++ b/netclient/wireguard/common.go @@ -94,6 +94,10 @@ func SetPeers(iface, currentNodeAddr string, keepalive int32, peers []wgtypes.Pe if peer.AllowedIPs[0].String() == currentPeer.AllowedIPs[0].String() { shouldDelete = false } + // re-check this if logic is not working, added in case of allowedips not working + if peer.PublicKey.String() == currentPeer.PublicKey.String() { + shouldDelete = false + } } if shouldDelete { output, err := ncutils.RunCmd("wg set "+iface+" peer "+currentPeer.PublicKey.String()+" remove", true)