Commit Graph

169 Commits

Author SHA1 Message Date
abe2651ad5 Removed remaining signals from peer
1. Removed remaining signals from peer struct
2. Made needAnotherKeepalive local
3. Removed environment check from warning text (annoying when debugging)
2018-05-05 22:07:58 +02:00
34891d92cd Merge branch 'master' of ssh://git.zx2c4.com/wireguard-go 2018-05-05 04:42:44 +02:00
8ba28be732 Use Int32n for jitter 2018-05-05 04:42:17 +02:00
beab52258a Merge branch 'master' of ssh://git.zx2c4.com/wireguard-go 2018-05-05 04:20:16 +02:00
d8d592787d Merge branch 'master' of ssh://git.zx2c4.com/wireguard-go 2018-05-05 04:15:41 +02:00
7a83f2565a Removed old signals 2018-05-05 04:15:07 +02:00
36659454ce tun: simplify and combine creation logic on Linux 2018-05-05 03:40:52 +02:00
142e53f698 Style 2018-05-05 02:48:21 +02:00
4d9f3a2f53 Merge branch 'master' of ssh://git.zx2c4.com/wireguard-go 2018-05-05 02:47:59 +02:00
4a177de09c tun: account for null termination on Linux 2018-05-05 02:47:35 +02:00
edbce6b400 Merge branch 'master' of ssh://git.zx2c4.com/wireguard-go 2018-05-05 02:23:03 +02:00
6db41d5a26 Initial version of migration to new event model
- Begin move away from global timer state.
- Made logging format more consistent
2018-05-05 02:20:52 +02:00
e1de0f229a uapi: use kqueue for sock deletion on darwin 2018-05-04 21:51:55 +02:00
ac898bb35a tun: print automatically assigned interface name to stdout
This way scripts know what process they just started.
2018-05-04 21:20:19 +02:00
de7ecc571b tun: allow darwin to auto assign names 2018-05-04 21:11:51 +02:00
0f322f83f5 warning: put into main 2018-05-04 19:50:08 +02:00
a040786645 global: Add SPDX tags and copyright header
Mathias should probably add his copyright headers to each file too.
2018-05-03 15:06:25 +02:00
209dd22ea0 Daemonize with environment variable 2018-05-03 14:55:10 +02:00
258a9223b9 Start to dust off Darwin 2018-05-03 14:55:10 +02:00
168ef61a63 Add missing locks and fix debug output, and try to flush queues
Flushing queues on exit is sort of a partial solution, but this could be
better. Really what we want is for no more packets to be enqueued after
isUp is set to false.
2018-05-01 17:46:28 +02:00
b34604245e Clear src cache if route changes to new ifindex 2018-04-27 05:41:07 +02:00
92261b770f Fix error handling and cleanup of netlink listener 2018-04-27 02:47:31 +02:00
0715bdf353 Fix wrong debug messages 2018-04-20 07:13:40 +02:00
5ba84696e2 Rework sticky sockets 2018-04-20 06:51:28 +02:00
f5c256affd Check for correct first nibble
The code before assumed that the flow label was always zero.
2018-04-20 06:51:28 +02:00
4973ea0c9e Signal using select and a pipe for bringing down TUN reader
Waiting on resolution of these to fix in better way:
- https://github.com/golang/go/issues/22939
- https://github.com/golang/go/issues/24331
2018-04-20 04:16:34 +02:00
676bb91434 We can determine the interface name ourselves 2018-04-19 16:00:20 +02:00
ab875491c0 Do not hard code MTU default 2018-04-19 15:54:51 +02:00
ac9912345b Fixed read from closed channel
A premature waitgroup .Done resulted in reading from closed channel.
This caused a nil-pointer deref & crash.

Added additional debugging when closing routines.
2018-04-18 20:29:48 +02:00
26a56a652e Allow determining name 2018-04-18 16:42:30 +02:00
0b940a7568 Use socketcall on x86 2018-04-18 10:17:04 +02:00
eb6728400b Use simple 16-bit integer for persistent keepalive
Races for this aren't a huge problem.
2018-04-18 07:24:33 +02:00
099219be2a Align 64-bit atomics
64-bit varibles that are accessed using the Go atomic functions must be
8-byte aligned on 32-bit platforms. Otherwise there are crashes.
2018-04-18 06:54:21 +02:00
6cecaf3157 Begin work on full device<->device unit-test
To simulate a full interaction between two WireGuard
instances without networking, using dummy instances of the interfaces
2018-03-08 16:44:46 +01:00
fd248c6cb1 Support nopi mode 2018-02-28 19:58:51 +01:00
09de7d1342 Close tun fd when bringing down tunnel 2018-02-18 22:54:33 +01:00
519c5d200a Fix timer typo 2018-02-18 20:58:43 +01:00
9de17e6c9c Seperated fwmark update code into function 2018-02-18 20:49:03 +01:00
8f1d1b8c54 MPLv2 for App Store 2018-02-13 19:43:47 +01:00
fa37039c3b Reimplemented bind_rtmgrp in pure Go
Getting rid of the Cgo dependency for listing on netlink.

Ported original patch from "syscall" to "golang.org/x/sys/unix".

Signed-off-by: Dominik Süß <dominik.suess@outlook.at>
Co-Authored-By: Mathias Hall-Andersen <mathias@hall-andersen.dk>
2018-02-13 16:43:07 +01:00
ff8f3a412e Use relative imports 2018-02-12 23:49:41 +01:00
ea4ea6f933 Revert "Don't use modules"
This reverts commit bffe99aead.
2018-02-12 22:29:11 +01:00
bffe99aead Don't use modules
Feel free to revert this if you have a strong feeling about it. But so
far as I can see, it adds a lot of complexity for basically no upsides.
2018-02-12 20:13:03 +01:00
77285c99aa Moved test-processes to background 2018-02-11 23:31:53 +01:00
6cba91999c TUN status hack was causing spam during shutdown 2018-02-11 23:26:54 +01:00
04ded4c631 Added missing mutex acquisition 2018-02-11 23:07:07 +01:00
8bdadaae59 Removed exported methods from ratelimiter package 2018-02-11 23:01:55 +01:00
5f0a91a127 Moved ratelimiter to internal package 2018-02-11 22:53:39 +01:00
1cf23c0005 Moved tai64n into sub-package 2018-02-11 19:25:33 +01:00
743364f647 Fixed tabs 2018-02-11 19:02:50 +01:00