Commit graph

31 commits

Author SHA1 Message Date
Jason A. Donenfeld 0a63188afa Move tun to subpackage 2018-05-23 03:58:27 +02:00
Jason A. Donenfeld b4cef2524f Fix integer conversions 2018-05-22 18:35:52 +02:00
Jason A. Donenfeld ff3f2455e5 Rework freebsd support 2018-05-21 18:48:48 +02:00
Jason A. Donenfeld 837a12c841 Close events channel when no status listener 2018-05-21 14:16:46 +02:00
Jason A. Donenfeld 6307bfcdf4 Close hack listener before closing channel 2018-05-21 03:31:46 +02:00
Jason A. Donenfeld 18f43705ec Fix race with closing event channel
There's still a tiny race on Linux, since the tun channel is written to
from two places.
2018-05-20 06:38:39 +02:00
Jason A. Donenfeld b95a4c61a5 Reduce the hack listener to once a second 2018-05-20 04:03:11 +02:00
Mathias Hall-Andersen 38accea986 Add copyright headers 2018-05-19 02:40:22 +02:00
Jason A. Donenfeld 795f76cffa Netlink sockets can't be shutdown 2018-05-14 14:08:03 +02:00
Jason A. Donenfeld 355e9bd619 Clean more 2018-05-14 12:27:29 +02:00
Jason A. Donenfeld 25df2e6942 Shorthand for empty channels 2018-05-14 04:19:25 +02:00
Jason A. Donenfeld f738c45a68 Smoother netlink shutdown 2018-05-14 03:44:57 +02:00
Jason A. Donenfeld 659106bd6d Ensure go routines can exit 2018-05-14 02:14:33 +02:00
Jason A. Donenfeld 7e10ebe101 Introduce rwcancel 2018-05-14 00:30:52 +02:00
Jason A. Donenfeld 2326d6a4d7 Odds and ends 2018-05-13 19:34:28 +02:00
Jason A. Donenfeld 36659454ce tun: simplify and combine creation logic on Linux 2018-05-05 03:40:52 +02:00
Jason A. Donenfeld 142e53f698 Style 2018-05-05 02:48:21 +02:00
Jason A. Donenfeld 4a177de09c tun: account for null termination on Linux 2018-05-05 02:47:35 +02:00
Jason A. Donenfeld 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
Jason A. Donenfeld b34604245e Clear src cache if route changes to new ifindex 2018-04-27 05:41:07 +02:00
Jason A. Donenfeld 92261b770f Fix error handling and cleanup of netlink listener 2018-04-27 02:47:31 +02:00
Jason A. Donenfeld 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
Jason A. Donenfeld 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
Jason A. Donenfeld 676bb91434 We can determine the interface name ourselves 2018-04-19 16:00:20 +02:00
Jason A. Donenfeld 26a56a652e Allow determining name 2018-04-18 16:42:30 +02:00
Jason A. Donenfeld fd248c6cb1 Support nopi mode 2018-02-28 19:58:51 +01:00
Jason A. Donenfeld 09de7d1342 Close tun fd when bringing down tunnel 2018-02-18 22:54:33 +01:00
Dominik Süß 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
Mathias Hall-Andersen 73cb1a1155 Reverted event changes
This feature was not needed for Android, upon further inspection.
2018-02-11 18:55:30 +01:00
Mathias Hall-Andersen b461343171 Started migration to sub-packages 2018-02-09 18:56:00 +01:00
Mathias Hall-Andersen a0f54cbe5a Align with go library layout 2018-02-04 16:08:26 +01:00
Renamed from src/tun_linux.go (Browse further)