Ecosyste.ms: OpenCollective
An open API service for software projects hosted on Open Collective.
github.com/SagerNet/wireguard-go
Mirror only. Official repository is at https://git.zx2c4.com/wireguard-go
https://github.com/SagerNet/wireguard-go
RoutineReadFromTUN can trigger a call to SendStagedPackets.
SendStagedPackets attempts to protec...
Signed-off-by: Jason A. Donenfeld <[email protected]>
30b96ba083e4ef61051f125770b50bd278712539 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>This serves two purposes.
First, it makes repeatedly stopping then starting a peer cheaper.
Sec...
Signed-off-by: Josh Bleecher Snyder <[email protected]>
cae090d116d4aa61494f5951a9d6ab6902017dce authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
The high iteration count was useful when TestUpDown
was the nexus of new bugs to investigate.
N...
465261310b55898c3f67809bd56d58442bca4554 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
On a many-core machine with the race detector enabled,
this test can take several minutes to com...
This is not necessary, and removing it speeds up detection of UAF bugs.
Signed-off-by: Josh Ble...
ecceaadd168ce682695acf1a5c004ef89e4927eb authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>This matches the new naming scheme of upLocked and downLocked.
Signed-off-by: Jason A. Donenfel...
9e728c2eb07e9d551bef2bcb3681ea0afc2dd1a0 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
It's never used and we won't have a use for it. Also, move to go-running
stringer, for those wit...
Signed-off-by: Jason A. Donenfeld <[email protected]>
6548a682a9a06cf7041e25f7aa5ac57f1f4cf3b4 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
Before, the code attached a finalizer to an object that wasn't returned,
resulting in immediate ...
Part of being actually idempotent is that we shouldn't penalize code
that takes advantage of thi...
Signed-off-by: Jason A. Donenfeld <[email protected]>
02138f1f8185c0b578a7b57122f59d9c9681f64b authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
Without this, we wind up freeing packets that the encryption/decryption
queues still have, resul...
The test previously checked the offset within a substruct, not the
offset within the allocated s...
Signed-off-by: Jason A. Donenfeld <[email protected]>
a816e8511eb45975e8e0e4199c3481989953fd56 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
a60e6dab76f1e2ff44d77e75df02f76c3f66e1ca authored almost 4 years ago by Jason A. Donenfeld <[email protected]>The immediate motivation for this change is an observed deadlock.
1. A goroutine calls peer.Sto...
d8dd1f254fc42878970d764b046ec5789ab30259 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
We have a bunch of stupid channel tricks, and I'm about to add more.
Give them their own file. T...
Signed-off-by: Josh Bleecher Snyder <[email protected]>
af408eb9400bd94a01eea5ece8fa3da62c911818 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
The TUN event reader does three things: Change MTU, device up, and device down.
Changing the MTU...
We already track this state elsewhere. No need to duplicate.
The cost of calling changeState is ...
timersInit sets up the timers.
It need only be done once per peer.
timersStart does the work to...
15810daa2283e3cfe0c811c3632f053274f31950 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
The old code silently accepted negative MTUs.
It also set MTUs above the maximum.
It also had ha...
This commit simplifies device state management.
It creates a single unified state variable and d...
elem.packet is always already nil.
Signed-off-by: Josh Bleecher Snyder <[email protected]>
da956772030b8b1fcbd37f82f08863070c93aa0f authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>It is no longer necessary.
Signed-off-by: Josh Bleecher Snyder <[email protected]>
9c75f58f3d8656e9e5394959a67b630f51f9dc98 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
It is no longer necessary, as of 454de6f3e64abd2a7bf9201579cd92eea5280996
(device: use channel c...
Signed-off-by: Jason A. Donenfeld <[email protected]>
4192036acd3b6442a60a5852b78979dde4b53ba5 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
9c7bd73be2cc7b706d471cd34d718852457e8cef authored almost 4 years ago by Jason A. Donenfeld <[email protected]>This papers over other unrelated races, unfortunately.
Signed-off-by: Jason A. Donenfeld <Jason...
01e176af3c2b36c7da3bfd8f92f7f578ecd4fbd6 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
The leak test had rare flakes.
If a system goroutine started at just the wrong moment, you'd get...
Signed-off-by: Jason A. Donenfeld <[email protected]>
7258a8973dfb2e3069fe1a8364966cfaadbdb4e1 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>This makes it easier to tag things onto the end manually for quick hacks.
Signed-off-by: Jason ...
d9d547a3f3f83f6ea23e140e3665ac41b6aca10a authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Here is the old implementation:
type WaitPool struct {
c chan interface{}
}
...
c3bde5f59099a3b21b016bf809b83ee3de126f80 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
fd63a233c9fedad2be4e26edbc540e11d9ea5968 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
8a374a35a0fe62dfd86df2c16166d2bb84115b93 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Channels are FIFO which means we have guaranteed cache misses.
Signed-off-by: Jason A. Donenfel...
48460703229d73fbacdd0d6b0d0f01a54f7ce751 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
a9f80d8c587df99c6e8f57704aef3fe1ac62d0db authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
de51129e33a5fe4fad3da172539e9be640d39211 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
beb25cc4fd31da09590fed3200628baf4c701f8b authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
9263014ed3f0a97800c893cb7346cc5109fc9e27 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
Suggested-by: Josh Bleecher Snyder <[email protected]>
Signed-off-by: Jason A. Donenfeld <Jason...
Signed-off-by: Jason A. Donenfeld <[email protected]>
d4112d9096f4bdd68f1a109bb12df82f5f4ca5a0 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>This is what modules are for, and Go binaries can introspect.
Signed-off-by: Jason A. Donenfeld...
bf3bb888512e74bee0b79bd38826cb019ca2a0ee authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
6a128dde71d925fd4865ebd86855213a429b4729 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
benchmark old ns/op new ns/op delta
BenchmarkUAPIGet-16 2872 ...
It's a separate type of key that gets hashed into the chain.
Signed-off-by: Jason A. Donenfeld ...
d4725bc45685187088c84234a6d2be396a1373e5 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
This moves to a simple queue with no routine processing it, to reduce
scheduler pressure.
This ...
1b092ce584cbee0f86f3e25b5498870c8ca96652 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
a11dec5dc12255ee032ce730eef3c82e77c84ed2 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
ace50a0529bdd69f32f637ee84845bde45de07b6 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>This makes the IpcGet method much faster.
We also refactor the traversal API to use a callback ...
8cc99631d025f5013e40f8a5a7b3370bff1c577e authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
There are very few cases, if any, in which a user only wants one of
these levels, so combine it ...
This commit overhauls wireguard-go's logging.
The primary, motivating change is to use a functi...
7139279cd0b08ebbd2c0322bc01d5678aa00cd0e authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>The declaration of err in
nextByte, err := buffered.ReadByte
shadows the declaration of err i...
37efdcaccfb16e47137728b5462c90d0b2ae8460 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
Caught by go vet.
Signed-off-by: Josh Bleecher Snyder <[email protected]>
Plenty more to go, but a start:
name old time/op new time/op delta
UAPIGet-4 6.3...
Signed-off-by: Josh Bleecher Snyder <[email protected]>
e6ec3852a93c95ac55662cc34a25b71a84c6e7b0 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Brad Fitzpatrick <[email protected]>
23b2790aa06270485f3d951132609afaeb888c28 authored almost 4 years ago by Brad Fitzpatrick <[email protected]>Signed-off-by: Jason A. Donenfeld <[email protected]>
a29767dda6db9811b547ceec593a7170dc33bd31 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>The original spec ends with \n\n especially for this reason.
Signed-off-by: Jason A. Donenfeld ...
18e47795e598973195887893e7d77baddec53ebb authored almost 4 years ago by Jason A. Donenfeld <[email protected]>Interleaves IpcSetOperations would spell trouble.
Signed-off-by: Josh Bleecher Snyder <josh@tai...
cecb41515d780213fd6b37bd04686f5296edf84c authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
a9ce4b762cd8b9898ff69571194ad3f09ad6d7bd authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
Also, a behavior change: Stop treating a blank value as 0.
It's not in the spec.
Signed-off-by:...
d8f2cc87ee66958226157c5bb77464eee23156c2 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
2b8665f5f973cd0b36722ba0a8689b91b99eec7d authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
674a4675a10ea7eb83fad2eada5bf7211c7575f3 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
87bdcb2ae472711c3b0b3679fbdb393e39b4dbc3 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
The goal of this change is to make the structure
of IpcSetOperation easier to follow.
IpcSetOpe...
6252de0db9331cbc20074e9d40165266b5816148 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
Unify the handling of unexpected UAPI errors.
The comment that says "should never happen" is inc...
The code as written will drop any read errors on the floor.
Fix that.
Signed-off-by: Josh Bleec...
675aae24232750e5a41c0a10bb1195fa4bb63d42 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
Expand IPCError to contain a wrapped error,
and add a helper to make constructing such errors ea...
If device.NewPeer returns a nil error,
then the returned peer is always non-nil.
Signed-off-by:...
db3fa1409cae2113df73f1641d9fb1830fbcc696 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
In order to avoid even the flirtation with passing on these dependencies
to ordinary consumers o...
The Go linker isn't smart enough to prevent gvisor from being pulled
into modules that use other...
Until we depend on Go 1.16 (which isn't released yet), alias our own
variable to the private mem...
Signed-off-by: Josh Bleecher Snyder <[email protected]>
6a2ecb581b5940ab82814fe836cb599705da9b8a authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
86a58b51c027feb3bf8836359fb3adf1c436c53d authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Type tcpip.Error is not an error.
I've filed https://github.com/google/gvisor/issues/5314
to fi...
Minor style fix.
Signed-off-by: Josh Bleecher Snyder <[email protected]>
f07177c762bfc4aab7d44a4b32432b8575007bec authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Newly allocated objects are already zeroed.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale...
7c5d1e355e6faa1551296c34aaced4ffe0b16d87 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
Now that we block when enqueueing to the decryption queue,
there is only one case in which we "d...
If we block when enqueuing encryption elements to the queue,
then we never drop them.
Signed-of...
7ee95e053c280796ecfb5533000915e7daa13f69 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
291dbcf1f0424f053d2fc52341590be264b8f47d authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Caught by 'go vet'.
Signed-off-by: Josh Bleecher Snyder <[email protected]>
abc88c82b13b6bf4cb1592ba4f7de58079c557cd authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>Signed-off-by: Josh Bleecher Snyder <[email protected]>
23642a13bed48c700144e4b346d054b8e47879a8 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
Block instead. Backpressure here is fine, probably preferable.
This reduces code complexity.
Si...
2fe19ce54db258d8c47ff03d8335fd28c7c7ad0f authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>This appears to have been an oversight.
Signed-off-by: Josh Bleecher Snyder <[email protected]>
0cc15e7c7c6fc2917cb1cea8ea3f10f7d375cac4 authored almost 4 years ago by Josh Bleecher Snyder <[email protected]>
This is similar to commit e1fa1cc5560020e67d33aa7e74674853671cf0a0,
but for the decryption chann...
This allows people to initiate connections over WireGuard without any
underlying operating syste...
Some users report seeing lines like:
> Routine: receive incoming IPv4 - stopped
Popping up une...
ea6c1cd7e6525f76041d341074a0e10b800d4e13 authored almost 4 years ago by Jason A. Donenfeld <[email protected]>
If Close is called after ReceiveIPvX, then ReceiveIPvX will block on an
invalid or potentially r...
It's possible for RoutineSequentialReceiver to try to lock an elem after
RoutineDecryption has e...
In each case, the starting waitgroup did nothing but ensure
that the goroutine has launched.
No...
c9e4a859ae8cdd7046a467afe8b50c5364c2cfc7 authored about 4 years ago by Josh Bleecher Snyder <[email protected]>
When running many concurrent test processing using
https://godoc.org/golang.org/x/tools/cmd/stre...
Signed-off-by: Josh Bleecher Snyder <[email protected]>
d0f8e9477c14a1c92f84beb46cd17b91c56fae44 authored about 4 years ago by Josh Bleecher Snyder <[email protected]>
One of the first rules of WaitGroups is that you call wg.Add
outside of a goroutine, not inside ...
The new test introduced in this commit used to deadlock about 1% of the time.
I believe that th...
e1fa1cc5560020e67d33aa7e74674853671cf0a0 authored about 4 years ago by Josh Bleecher Snyder <[email protected]>
Picking two free ports to use for a test is difficult.
The free port we selected might no longer...
This is particularly problematic on mobile,
where there is a fixed number of elements.
If most o...
Persnickety consumers can now do:
func init() {
tun.WintunPool, _ = wintun.MakePool...