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

device: use channel close to shut down and drain outbound channel

This is a similar treatment to the handling of the encryption
channel found a few commits ago: U...

2832e96339b4b847172741e9252020fc7bfa59af authored about 4 years ago
device: use LogLevelError for benchmarking

This keeps the output minimal and focused on the benchmark results.

Signed-off-by: Josh Bleeche...

8a304155554a16285b5334ae4a02e09adfb0bde1 authored about 4 years ago
device: accept any io.Reader in device.IpcSetOperation

Any io.Reader will do, and there are no performance concerns here.
This is technically backwards...

93a4313c3a809afe67f1dc430f544282af2b388c authored about 4 years ago
wintun: do not load dll in init()

This prevents linking to wintun.dll until it's actually needed, which
should improve startup tim...

ca9edf1c6301ed1498a56124d018474a68d04b25 authored about 4 years ago
device: remove QueueInboundElement leak with stopped peers

This is particularly problematic on mobile,
where there is a fixed number of elements.
If most o...

b5f966ac2439df9eba182886406f6381934948ad authored about 4 years ago
device: add missing colon to error line

People are actually hitting this condition, so make it uniform. Also,
change a printf into a pri...

ad73ee78e90823a92eacf7521173308a392e8323 authored about 4 years ago
device: fix persistent_keepalive_interval data races

Co-authored-by: David Anderson <[email protected]>
Signed-off-by: Josh Bleecher Snyder <jo...

63066ce4062a85224821ce302e3eb8c34e95a658 authored about 4 years ago
device: make test infrastructure usable with benchmarks

Switch from *testing.T to testing.TB.

Signed-off-by: Josh Bleecher Snyder <[email protected]>

cdaf4e9a76ed9485ff67c1601a947fcb8089a680 authored about 4 years ago
device: remove starting waitgroups

In each case, the starting waitgroup did nothing but ensure
that the goroutine has launched.

No...

c9e4a859ae8cdd7046a467afe8b50c5364c2cfc7 authored about 4 years ago
conn: do not SO_REUSEADDR on linux

SO_REUSEADDR does not make sense for unicast UDP sockets.

Signed-off-by: Jason A. Donenfeld <Ja...

890cc06ed577420b04676d4b2d7a7daae5fb0030 authored about 4 years ago
device: increase timeout in tests

When running many concurrent test processing using
https://godoc.org/golang.org/x/tools/cmd/stre...

db1edc7e915635dfd31554f8f9a80d6e20740926 authored about 4 years ago
device: remove unnecessary zeroing

Signed-off-by: Josh Bleecher Snyder <[email protected]>

d0f8e9477c14a1c92f84beb46cd17b91c56fae44 authored about 4 years ago
device: call wg.Add outside the goroutine

One of the first rules of WaitGroups is that you call wg.Add
outside of a goroutine, not inside ...

b42e32047d16cc4389ef63550e525c7b08320172 authored about 4 years ago
device: add UAPI helper methods

Signed-off-by: Jason A. Donenfeld <[email protected]>

40dfc85defd8d47b9d371becc36796d6edc43d05 authored about 4 years ago
tun: make customization of WintunPool and requested GUID more obvious

Persnickety consumers can now do:

func init() {
tun.WintunPool, _ = wintun.MakePool...

d664444928f91c01a2c7583fdb58983c308e9b4d authored about 4 years ago
device: fix data race in peer.timersActive

Found by the race detector and existing tests.

To avoid introducing a lock into this hot path,
...

f7bbdc31a0065e3d5a68a3e6c7a7449954fdd339 authored about 4 years ago
tun/tuntest: make genICMPv4 allocate less

It doesn't really matter, because it is only used in tests,
but it does remove some noise from p...

347ce76bbcc6d2351dc298a1c8ca5604534bebec authored about 4 years ago
device: avoid copying lock in tests

This doesn't cause any practical problems as it is,
but vet (rightly) flags this code as copying...

c4895658e629ed9d5154c73eb5585c12fdba5b4b authored about 4 years ago
device: clear pointers when returning elems to pools

Signed-off-by: Josh Bleecher Snyder <[email protected]>

d3ff2d6b62b095f37582affe84e267d7e5be88c6 authored about 4 years ago
device: use labeled for loop instead of goto

Minor code cleanup; no functional changes.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale....

01d3aaa7f418dd0ca86643ddcc8c82544cb8398b authored about 4 years ago
memmod: fix import loading function usage

Signed-off-by: Jason A. Donenfeld <[email protected]>

b6303091fc8c11cf86b92e9c4287c0ba74e77e87 authored about 4 years ago
wintun: log when reboot is suggested by Windows

Which really shouldn't happen. But it is a useful information for
troubleshooting.

Signed-off-b...

c9fabbd5bf12b7abae6f00fe666edec3a8af7106 authored about 4 years ago
wintun: keep original error when Wintun session start fails

Signed-off-by: Simon Rozman <[email protected]>

4cc7a7a455b0796d6300a6f3ef69e9041ec900d4 authored about 4 years ago
version: bump snapshot

da19db415a588e72fb8b13e5b5aa0b97db7cc30b authored about 4 years ago
mod: bump

Signed-off-by: Jason A. Donenfeld <[email protected]>

52c834c4469f4f6e33c97c7294faffabfcbf114a authored about 4 years ago
device: add write queue mutex for peer

fix panic: send on closed channel when remove peer

Signed-off-by: Haichao Liu <liuhaichao@byted...

913f68ce3820801e045632cb05c6f11e0df50b47 authored about 4 years ago
wintun: load from filesystem by default

We let people loading this from resources opt in via:

go build -tags load_wintun_from_rsrc
...

60b3766b89b9cc664d9bbdc9ab34b283e0374d21 authored about 4 years ago
global: switch to using %w instead of %v for Errorf

Signed-off-by: Jason A. Donenfeld <[email protected]>

82128c47d90a54faded017ad3e5bc61eb0c641db authored about 4 years ago
mod: update deps

Signed-off-by: Jason A. Donenfeld <[email protected]>

c192b2eeec5dc8e21e8a6deb5e6dcceda91d649c authored about 4 years ago
wintun: ring management moved to wintun.dll

Signed-off-by: Simon Rozman <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>

a3b231b31eb58da7cef097b6633bcc97484b550d authored about 4 years ago
wintun: load wintun.dll from RCDATA resource

Signed-off-by: Simon Rozman <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>

65e03a918274534015ca189bfadc33cbba9e3ec8 authored about 4 years ago
wintun: migrate to wintun.dll API

Rather than having every application using Wintun driver reinvent the
wheel, the Wintun device/a...

3e08b8aee0f6ae038f6316ca1bb84e5214db318f authored about 4 years ago
device: format a few things

Signed-off-by: Jason A. Donenfeld <[email protected]>

5ca1218a5c16fb9b5e99b61c0b5758f66087e2e4 authored about 4 years ago
tun: use GetsockoptString in (*NativeTun).Name on macOS

Direct syscalls using unix.Syscall(unix.SYS_*, ...) are discouraged on
macOS and might not be su...

36dc8b6994514e42fcdf00ba91774148afbefc1c authored about 4 years ago
tun: use Ioctl{Get,Set}IfreqMTU from golang.org/x/sys/unix on macOS

Direct syscalls using unix.Syscall(unix.SYS_*, ...) are discouraged on
macOS and might not be su...

e6b7c4eef3f914c8657ca02676e48f61e8bf3ed8 authored about 4 years ago
go.mod: bump golang.org/x/sys to latest version

This adds the fixes for golang/go#41868 which are needed to build
wireguard without direct sysca...

2057f19a61cedbb0fef88823c832b04165325ab1 authored about 4 years ago
tun: use SockaddrCtl from golang.org/x/sys/unix on macOS

Direct syscalls using unix.Syscall(unix.SYS_*, ...) are discouraged on
macOS and might not be su...

3b490f30aa4d8762d89a51d90f330b39f0be5fef authored about 4 years ago
tun: use IoctlCtlInfo from golang.org/x/sys/unix on macOS

Direct syscalls using unix.Syscall(unix.SYS_*, ...) are discouraged on
macOS and might not be su...

8ae09213a7ba2520dd4c206c76d1730a55408519 authored about 4 years ago
tun/wintun/registry: fix Go 1.15 race/checkptr failure

Signed-off-by: Brad Fitzpatrick <[email protected]>
[Jason: ran go mod tidy.]
Signed-off-by...

58a8f05f50b633bb45c7cc299c405618489c18ad authored over 4 years ago
Makefile: Add test target

Signed-off-by: Frank Werner <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>

0b54907a73ce0810c3a148007c45e66eae7109d6 authored over 4 years ago
replay: minor API changes to more idiomatic Go

Signed-off-by: Riobard Zhan <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>

2c143dce0ff55feb35c7f6b9199479db88909903 authored over 4 years ago
replay: clean up internals and better documentation

Signed-off-by: Riobard Zhan <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>

22af3890f60d11472977f2fbdf50e6d5b406e356 authored over 4 years ago
device: remove global for roaming escape hatch

Signed-off-by: Jason A. Donenfeld <[email protected]>

c8fe925020de61b30eec2bc016fb7f45df78dc6c authored over 4 years ago
replay: divide by bits-per-byte

Bits / Bytes-per-Word misses the step of also dividing by Bits-per-Byte,
which we need in order ...

0cfa3314ee2740cd94cf7064cc79fdea7b1e0dde authored over 4 years ago
device: get free port when testing

Signed-off-by: Sina Siadat <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>

bc3f505efa9f4f780d21165311df34ca0e8d7e20 authored over 4 years ago
device: remove bindsocketshim.go

Both wireguard-windows and wireguard-android access Bind
directly for these methods now.

Signed...

507f148e1c42d2deaac524e759115a1b02730207 authored over 4 years ago
device: remove some unnecessary unsafe

Signed-off-by: Brad Fitzpatrick <[email protected]>

31b574ef99a79fb654085693423f48a3bf0e7f81 authored over 4 years ago
device: use RTMGRP_IPV4_ROUTE to specify multicast groups mask

Use the RTMGRP_IPV4_ROUTE const from x/sys/unix instead of using the
corresponding RTNLGRP_IPV4_...

3c41141fb47781f5c7526662ef057c2aa3d71757 authored over 4 years ago
device: wait for routines to stop before removing peers

Peers are currently removed after Device's goroutines are signaled to stop,
but without waiting ...

4369db522b3fd7adc28a2a82b89315a6f3edbcc4 authored over 4 years ago
device: export Bind and remove socketfd shims for android

Signed-off-by: David Crawshaw <[email protected]>

b84f1d4db25e6e7de29551d3fd9c3c10e0b731e1 authored over 4 years ago
ipc: add comment about socketDirectory linker override on android

Signed-off-by: David Crawshaw <[email protected]>

dfb28757f799e02840e8939ca739107f2560f53f authored over 4 years ago
conn: add comments saying what uses these interfaces

Signed-off-by: David Crawshaw <[email protected]>

00bcd865e6996f932ea0dcacf7df015f79307153 authored over 4 years ago
device: do not include sticky sockets on android

Signed-off-by: Jason A. Donenfeld <[email protected]>

f28a6d244b5133439d408b9fe13e12e9917f9646 authored over 4 years ago
conn: unbreak boundif on android

Another thing never tested ever.

Signed-off-by: Jason A. Donenfeld <[email protected]>

c403da6a39c876123c096113d08d0d3019b4a07e authored over 4 years ago
conn: remove useless comment

Signed-off-by: Jason A. Donenfeld <[email protected]>

d6de6f3ce6c24841d29b563d3283a0fd85e437ac authored over 4 years ago
conn: fix windows situation with boundif

This was evidently never tested before committing.

Signed-off-by: Jason A. Donenfeld <Jason@zx2...

59e556f24ec7503eda8ff15f026b2df44e096b6f authored over 4 years ago
replay: account for fqcodel reordering

Signed-off-by: Jason A. Donenfeld <[email protected]>

31faf4c1598c67ba3b2ade4471e0a80ee4b0c968 authored over 4 years ago
device: rework padding calculation and don't shadow paddedSize

Reported-by: Jayakumar S <[email protected]>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c...

99eb7896be17cc688f001886469fb109b0575cad authored over 4 years ago
tai64n: make the test deterministic

In the presence of preemption, the current test may fail transiently.
This uses static test data...

f60b3919bec891d37652edc25c48d83345d9885c authored over 4 years ago
main: now that we're upstreamed, relax Linux warning

Signed-off-by: Jason A. Donenfeld <[email protected]>

da9d300cf8b50d1cf629b7fa4423d122a74a6871 authored over 4 years ago
README: specify go 1.13

Due to the use of the new errors module, we now require at least 1.13
instead of 1.12.

Signed-o...

59c99297141fe247e9b3fa895b3f779d9ac6eadf authored over 4 years ago
global: update header comments and modules

Signed-off-by: Jason A. Donenfeld <[email protected]>

db0aa39b765243c6a4ac9a2e348311df9517c0bf authored over 4 years ago
ipc: deduplicate some unix-specific code

Cleans up and splits out UAPIOpen to its own file.

Signed-off-by: David Crawshaw <crawshaw@tail...

bc77de2acaebe8589193e621933aa42783926aad authored over 4 years ago
ipc: remove unnecessary error check

os.MkdirAll never returns an os.IsExist error.

Signed-off-by: David Crawshaw <crawshaw@tailscal...

c8596328e7f769fdd313f981bb3b2de38b40c80c authored over 4 years ago
device: use atomic access for unlocked keypair.next

Go's GC semantics might not always guarantee the safety of this, and the
race detector gets upse...

28c4d043048e8bb7167e96df6558a6366306fc17 authored over 4 years ago
tun: return a better error message if /dev/net/tun doesn't exist

It was just returning "no such file or directory" (the String of the
syscall.Errno returned by C...

2fb0a712f0ca2f9a922cdc4f1f47b88c3ee70048 authored over 4 years ago
device: add debug logs describing handshake rejection

Useful in testing when bad network stacks repeat or
batch large numbers of packets.

Signed-off-...

d60857e1a7d82735c01f893f644455fc7ccc423f authored over 4 years ago
wintun: make remaining HWID comparisons case insensitive

c85e4a410f27986a2967a49c0155633c716bf3ca introduced preliminary HWID
checking to speed up Wintun...

fdba6c183aa8d4c19680f436517624038a6f3be5 authored over 4 years ago
setupapi: extend struct size constant definitions for arm(64)

Signed-off-by: Simon Rozman <[email protected]>

250b9795f3670981f5e276773307e9638ec0aee2 authored over 4 years ago
device: return generic error from Ipc{Get,Set}Operation.

This makes uapi.go's public API conform to Go style in terms
of error types.

Signed-off-by: Dav...

f2c6faad44fa70cdc8ef80385ca9826bbf0468d9 authored over 4 years ago
device: give handshake state a type

And unexport handshake constants.

Signed-off-by: David Crawshaw <[email protected]>

de374bfb44945e241d93ca821f35f6e3078e506b authored over 4 years ago
tun: remove unused isUp method

Signed-off-by: Brad Fitzpatrick <[email protected]>

abd287159e7eb7d20ee46c03d1a8cb9a645735e4 authored over 4 years ago
conn: introduce new package that splits out the Bind and Endpoint types

The sticky socket code stays in the device package for now,
as it reaches deeply into the peer l...

203554620dc8114de1ff70bb30b80f828e9e26ad authored over 4 years ago
tun: fix data race on name field

Signed-off-by: Brad Fitzpatrick <[email protected]>

85a45a9651d2b38e3616a7899800601656cf143e authored over 4 years ago
tuntest: split out testing package

This code is useful to other packages writing tests.

Signed-off-by: David Crawshaw <crawshaw@ta...

1a1c3d096888816c94cf1eb7c2747e83f008549f authored over 4 years ago
tun: NetlinkListener: don't send EventDown before sending EventUp

This works around a startup race condition when competing with
HackListener, which is trying to ...

c76b8184663e4b80ff8c26aafe9ec0ec91ff9116 authored over 4 years ago
device: add test to ensure Peer fields are safe for atomic access on 32-bit

Adds a test that will fail consistently on 32-bit platforms if the
struct ever changes again to ...

3dce460c88a84922fdeab246a1b3ebddf796093d authored over 4 years ago
wintun: split error message for create vs open namespace.

Signed-off-by: Avery Pennarun <[email protected]>

6aefb61355c9da539383dd0c2bc5f2bb3dbb3963 authored over 4 years ago
rwcancel: no-op builds for windows and darwin

This lets us include the package on those platforms in a
followup commit where we split out a co...

224bc9e60c7e2e1f04573bc377121c8f844d57c6 authored almost 5 years ago
ratelimiter: use a fake clock in tests and style cleanups

The existing test would occasionally flake out with:

--- FAIL: TestRatelimiter (0.12s)
ra...

9cd8909df2ad882b81b611b4656020aeceb6c9b2 authored almost 5 years ago
version: bump snapshot

ae88e2a2cda0faab68ad667223cd26ffd54d1bee authored almost 5 years ago
noise: unify zero checking of ecdh

4739708ca4fa68e2dd1915618d8cba113dac9312 authored almost 5 years ago
global: use RTMGRP_* consts from x/sys/unix

Update the golang.org/x/sys/unix dependency and use the newly introduced
RTMGRP_* consts instead...

b33219c2cfd430215f2230c15fc4c2f888a081c2 authored almost 5 years ago
send: account for zero mtu

Don't divide by zero.

9cbcff10dd3e04671d31ab224526f3d22a7ba665 authored almost 5 years ago
uapi: allow unsetting device private key with /dev/null

cb4bb63030d09afe7ee78fd49613b86709fdc006 authored almost 5 years ago
device: fix private key removal logic

6ed56ff2dfd57ba47cdf604eb3c455acb553c0df authored almost 5 years ago
version: bump snapshot

05b03c675090df893e8317983702c9661dfc319b authored about 5 years ago
tun: darwin: ignore ENOMEM errors

Coauthored-by: Andrej Mihajlov <[email protected]>

caebdfe9d05901230dd7c6b7569be2903fd8ac87 authored about 5 years ago
tun: windows: serialize write calls

4fa2ea6a2dabad50eb5585d0a56c3a6966604fa6 authored about 5 years ago
README: update repo urls

89dd065e53e986234289a0ace66539873be8b075 authored about 5 years ago
device: SendmsgN mutates the input sockaddr

So we take a new granular lock to prevent concurrent writes from
racing.

WARNING: DATA RACE
Wri...

ddfad453cf22146e9476a5f4b91cf6c47b77e9c7 authored about 5 years ago
wintun: manage ring memory manually

It's large and Go's garbage collector doesn't deal with it especially
well.

2b242f93932e1c4ab8b45dd0f628dd4fe063699b authored about 5 years ago
constants: recalculate rekey max based on a one minute flood

Discussed-with: Mathias Hall-Andersen <[email protected]>

4cdf805b29b1aaca1fab317ca4fce54c7fd69bf6 authored about 5 years ago
global: fix a few typos courtesy of codespell

Signed-off-by: Jonathan Tooker <[email protected]>

f7d0edd2ecf5f7f5aed188823de0a122691a7de6 authored over 5 years ago
device: allow blackholing sockets

ffffbbcc8a3344a45c45884f11a1aee1407615ab authored over 5 years ago
device: remove dead error reporting code

47b02c618bcd4f65726bc2c57538296e430a842c authored over 5 years ago
namespaceapi: remove tasteless comment

fd23c66fcdc6b105bda2aea24f595b9c356c3670 authored over 5 years ago
device: recheck counters while holding write lock

ae492d1b359918d20fda817e31675f126c7a7837 authored over 5 years ago
wintun: normalize variable names for their types

95fbfccf60b7d8528e5f89bcf01d132516af5817 authored over 5 years ago
wintun: quickly ignore non-Wintun devices

Some devices take ~2 seconds to enumerate on Windows if we try to get
their instance name. The ...

c85e4a410f27986a2967a49c0155633c716bf3ca authored over 5 years ago