Development discussion of WireGuard
 help / color / mirror / Atom feed
* Patch: initialise device.peers.empty
@ 2021-02-25  9:50 Laura Zelenku
  2021-02-25 10:47 ` Jason A. Donenfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Laura Zelenku @ 2021-02-25  9:50 UTC (permalink / raw)
  To: wireguard

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: initialise device.peers.empty
  2021-02-25  9:50 Patch: initialise device.peers.empty Laura Zelenku
@ 2021-02-25 10:47 ` Jason A. Donenfeld
  2021-02-25 11:29   ` Jason A. Donenfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Jason A. Donenfeld @ 2021-02-25 10:47 UTC (permalink / raw)
  To: Laura Zelenku; +Cc: wireguard

Hi Laura,

Thanks for the patch. Can you resubmit this as a proper git-formatted
patch containing your Signed-off-by line?

git commit -s --amend --no-edit
git send-email HEAD~

Also, you mentioned custom unit tests. Any of those suitable for
sending upstream?

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: initialise device.peers.empty
  2021-02-25 10:47 ` Jason A. Donenfeld
@ 2021-02-25 11:29   ` Jason A. Donenfeld
  0 siblings, 0 replies; 3+ messages in thread
From: Jason A. Donenfeld @ 2021-02-25 11:29 UTC (permalink / raw)
  To: Laura Zelenku; +Cc: WireGuard mailing list

Fixed differently here:
https://git.zx2c4.com/wireguard-go/commit/?id=355fed440bd066b8aa32e63e04c7f92e7a097d88

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-25 11:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25  9:50 Patch: initialise device.peers.empty Laura Zelenku
2021-02-25 10:47 ` Jason A. Donenfeld
2021-02-25 11:29   ` Jason A. Donenfeld

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).