aboutsummaryrefslogtreecommitdiffstats
path: root/uapi.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 03:29:21 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 03:29:21 +0200
commite75d2d4496643ef6b4033d574cd47b92aeb21a11 (patch)
treec2a00f4923d77e5bccad67aecd8d5e08f85066ac /uapi.go
parentLook up route for every peer (diff)
downloadwireguard-go-e75d2d4496643ef6b4033d574cd47b92aeb21a11.tar.xz
wireguard-go-e75d2d4496643ef6b4033d574cd47b92aeb21a11.zip
Fix dummy additions
Diffstat (limited to 'uapi.go')
-rw-r--r--uapi.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/uapi.go b/uapi.go
index 53a598e..9858f60 100644
--- a/uapi.go
+++ b/uapi.go
@@ -235,14 +235,13 @@ func ipcSetOperation(device *Device, socket *bufio.ReadWriter) *IPCError {
dummy = device.staticIdentity.publicKey.Equals(publicKey)
device.staticIdentity.mutex.RUnlock()
+
if dummy {
peer = &Peer{}
+ } else {
+ peer = device.LookupPeer(publicKey)
}
- // find peer referenced
-
- peer = device.LookupPeer(publicKey)
-
if peer == nil {
peer, err = device.NewPeer(publicKey)
if err != nil {