Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | global: fix a few typos courtesy of codespell | Jonathan Tooker | 2019-10-22 | 1 | -1/+1 |
| | | | | Signed-off-by: Jonathan Tooker <jonathan.tooker@netprotect.com> | ||||
* | tun: remove TUN prefix from types to reduce stutter elsewhere | Matt Layher | 2019-06-14 | 1 | -16/+16 |
| | | | | Signed-off-by: Matt Layher <mdlayher@gmail.com> | ||||
* | global: fixup TODO comment spacing | Jason A. Donenfeld | 2019-06-06 | 1 | -1/+1 |
| | |||||
* | global: regroup all imports | Jason A. Donenfeld | 2019-05-14 | 1 | -3/+4 |
| | |||||
* | receive: implement flush semantics | Jason A. Donenfeld | 2019-03-21 | 1 | -0/+5 |
| | |||||
* | tun: linux: work out netpoll trick | Jason A. Donenfeld | 2019-03-07 | 1 | -54/+46 |
| | |||||
* | tun: import mobile particularities | Jason A. Donenfeld | 2019-03-04 | 1 | -0/+22 |
| | |||||
* | tun: allow special methods in NativeTun | Jason A. Donenfeld | 2019-03-01 | 1 | -14/+14 |
| | |||||
* | tun: linux: netpoll is broken for tun's epoll | Jason A. Donenfeld | 2019-02-27 | 1 | -27/+48 |
| | | | | | | So this mostly reverts the switch to Sysconn for Linux. Issue: https://github.com/golang/go/issues/30426 | ||||
* | tun: linux: netlink sock needs cleaning up but file will be gc'd | Jason A. Donenfeld | 2019-02-27 | 1 | -4/+2 |
| | |||||
* | tun: use netpoll instead of rwcancel | Jason A. Donenfeld | 2019-02-27 | 1 | -41/+13 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new sysconn function of Go 1.12 makes this possible: package main import "log" import "os" import "unsafe" import "time" import "syscall" import "sync" import "golang.org/x/sys/unix" func main() { fd, err := os.OpenFile("/dev/net/tun", os.O_RDWR, 0) if err != nil { log.Fatal(err) } var ifr [unix.IFNAMSIZ + 64]byte copy(ifr[:], []byte("cheese")) *(*uint16)(unsafe.Pointer(&ifr[unix.IFNAMSIZ])) = unix.IFF_TUN var errno syscall.Errno s, _ := fd.SyscallConn() s.Control(func(fd uintptr) { _, _, errno = unix.Syscall( unix.SYS_IOCTL, fd, uintptr(unix.TUNSETIFF), uintptr(unsafe.Pointer(&ifr[0])), ) }) if errno != 0 { log.Fatal(errno) } b := [4]byte{} wait := sync.WaitGroup{} wait.Add(1) go func() { _, err := fd.Read(b[:]) log.Print("Read errored: ", err) wait.Done() }() time.Sleep(time.Second) log.Print("Closing") err = fd.Close() if err != nil { log.Print("Close errored: " , err) } wait.Wait() log.Print("Exiting") } | ||||
* | tun: use sysconn instead of .Fd with Go 1.12 | Jason A. Donenfeld | 2019-02-27 | 1 | -24/+21 |
| | |||||
* | Change package path | Jason A. Donenfeld | 2019-02-18 | 1 | -1/+1 |
| | |||||
* | Update copyright | Jason A. Donenfeld | 2019-02-05 | 1 | -2/+2 |
| | |||||
* | tun: remove nonblock hack for linux | Jason A. Donenfeld | 2018-12-06 | 1 | -10/+0 |
| | | | | | | This is no longer necessary and actually breaks things Reported-by: Chris Branch <cbranch@cloudflare.com> | ||||
* | tun: only call .Fd() once | Jason A. Donenfeld | 2018-10-17 | 1 | -15/+17 |
| | | | | | Doing so tends to make the tunnel blocking, so we only retrieve it once before we call SetNonblock, and then cache the result. | ||||
* | global: fix up copyright headers | Jason A. Donenfeld | 2018-09-16 | 1 | -2/+1 |
| | |||||
* | Fix duplicate copyright line | Jason A. Donenfeld | 2018-07-30 | 1 | -2/+0 |
| | |||||
* | Catch EINTR | Jason A. Donenfeld | 2018-05-24 | 1 | -3/+3 |
| | |||||
* | Adopt GOPATH | Jason A. Donenfeld | 2018-05-23 | 1 | -1/+1 |
| | | | | | GOPATH is annoying, but the Go community pushing me to adopt it is even more annoying. | ||||
* | Move tun to subpackage | Jason A. Donenfeld | 2018-05-23 | 1 | -0/+468 |