]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Fix dummy additions
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 14 May 2018 01:29:21 +0000 (03:29 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 14 May 2018 01:29:21 +0000 (03:29 +0200)
uapi.go

diff --git a/uapi.go b/uapi.go
index 53a598e849e06457bfd4ebd0f7ed0ff0e201db3f..9858f60ca04841c514ed062d3f0346939b407f24 100644 (file)
--- 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 {