Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Laura Zelenku <laura.zelenku@wandera.com>
To: wireguard@lists.zx2c4.com
Subject: Patch: initialise device.peers.empty
Date: Thu, 25 Feb 2021 10:50:14 +0100	[thread overview]
Message-ID: <F332C4E6-0559-4BE0-8AF6-3AD942C01FAC@wandera.com> (raw)

Hi devs,
in some custom unit test for wireguard go I’m experiencing failed tests because “device.peers.empty” contains default “false” value right after device creation. Please apply following patch to initialise the value to true (empty = true) in device creation.

thanks
Laura

Index: device/device.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- device/device.go	(revision 7a0fb5bbb1720fdd9404a4cf41920e24a46e0dad)
+++ device/device.go	(date 1614241756159)
@@ -292,6 +292,7 @@
 	}
 	device.tun.mtu = int32(mtu)
 	device.peers.keyMap = make(map[NoisePublicKey]*Peer)
+	device.peers.empty.Set(true)
 	device.rate.limiter.Init()
 	device.indexTable.Init()
 	device.PopulatePools()



-- 
*IMPORTANT NOTICE*: This email, its attachments and any rights attaching 
hereto are confidential and intended exclusively for the person to whom the 
email is addressed. If you are not the intended recipient, do not read, 
copy, disclose or use the contents in any way. Wandera accepts no liability 
for any loss, damage or consequence resulting directly or indirectly from 
the use of this email and attachments.

             reply	other threads:[~2021-02-25  9:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  9:50 Laura Zelenku [this message]
2021-02-25 10:47 ` Jason A. Donenfeld
2021-02-25 11:29   ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F332C4E6-0559-4BE0-8AF6-3AD942C01FAC@wandera.com \
    --to=laura.zelenku@wandera.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).