Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | tun: windows: Attempt to reopen handle on all errors | Simon Rozman | 2019-04-03 | 1 | -15/+9 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | wintun: rename device using undocumented API that netsh.exe uses | Jason A. Donenfeld | 2019-04-01 | 2 | -1/+41 |
| | |||||
* | wintun: add more retry loops | Jason A. Donenfeld | 2019-04-01 | 3 | -30/+56 |
| | |||||
* | tun: windows: cancel ongoing reads on closing and delete after close | Jason A. Donenfeld | 2019-03-26 | 1 | -4/+11 |
| | | | | | This reverts commit 52ec440d7977fad966002c3710ed9df957943407 and adds some spice. | ||||
* | wintun: query for NetCfgInstanceId several times | Jason A. Donenfeld | 2019-03-22 | 1 | -5/+16 |
| | |||||
* | tun: windows: delete interface before deleting file handles | Jason A. Donenfeld | 2019-03-22 | 1 | -9/+4 |
| | |||||
* | tun: windows: Make adapter rename asynchronous | Simon Rozman | 2019-03-22 | 2 | -60/+13 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | tun: windows: Adapter devices renamed to WINTUN<LUID Index> | Simon Rozman | 2019-03-22 | 4 | -52/+63 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | tun: windows: Increase unavailable adapter timeout to 30sec | Simon Rozman | 2019-03-22 | 1 | -1/+1 |
| | | | | | | 5 seconds was too short when debugging. Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | tun: windows: Make writing persistent too | Simon Rozman | 2019-03-22 | 1 | -15/+17 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | tun: windows: Fix paused adapter test | Simon Rozman | 2019-03-22 | 1 | -1/+1 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | tun: windows: just open two file handles | Jason A. Donenfeld | 2019-03-21 | 3 | -162/+83 |
| | |||||
* | receive: implement flush semantics | Jason A. Donenfeld | 2019-03-21 | 12 | -98/+147 |
| | |||||
* | tun: windows: add dummy overlapped events back | Jason A. Donenfeld | 2019-03-21 | 1 | -2/+21 |
| | | | | These seem basically wrong to me, but we get crashes without them. | ||||
* | tun: windows: use new constants in sys | Jason A. Donenfeld | 2019-03-20 | 3 | -13/+15 |
| | |||||
* | uapi: remove unhelpful log messages | Jason A. Donenfeld | 2019-03-20 | 1 | -7/+0 |
| | |||||
* | wintun: Use native Win32 API for I/O | Simon Rozman | 2019-03-21 | 5 | -38/+173 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | uapi: report endpoint error | Jason A. Donenfeld | 2019-03-19 | 1 | -1/+1 |
| | |||||
* | tun: windows: wintun does iocp | Jason A. Donenfeld | 2019-03-18 | 2 | -142/+49 |
| | |||||
* | tun: windows: temporary hack for forcing MTU | Jason A. Donenfeld | 2019-03-13 | 1 | -1/+8 |
| | |||||
* | wintun: Poll more often | Jason A. Donenfeld | 2019-03-10 | 1 | -1/+1 |
| | |||||
* | uapi: make ipcerror conform to interface | Jason A. Donenfeld | 2019-03-10 | 1 | -2/+2 |
| | |||||
* | wintun: Make errors more descriptive | Simon Rozman | 2019-03-08 | 1 | -15/+20 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | wintun: Return correct reboot-req flag on CreateInterface() error too | Simon Rozman | 2019-03-08 | 1 | -1/+1 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | wintun: Fix double-quoted strings escaping on output | Simon Rozman | 2019-03-08 | 2 | -4/+4 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | wintun: Introduce SetupAPI enumerator and machineName consts | Simon Rozman | 2019-03-08 | 1 | -4/+7 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | Windows: Apply strict security descriptor on pipe server | Odd Stranne | 2019-03-08 | 1 | -1/+12 |
| | | | | Signed-off-by: Odd Stranne <odd@mullvad.net> | ||||
* | uapi: windows: work out pipe semantics | Jason A. Donenfeld | 2019-03-08 | 1 | -2/+2 |
| | | | | | | | Pipes can be arranged like this, so that's fine. We also apply a strict SDDL that can't be inherited and only gives access to local system. Developed-with: Odd Stranne <odd@mullvad.net> | ||||
* | wintun: Cleanup | Simon Rozman | 2019-03-07 | 1 | -1/+1 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | wintun: Refactor network registry key name generation | Simon Rozman | 2019-03-07 | 1 | -22/+18 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | wintun: Revise interface creation wait | Simon Rozman | 2019-03-07 | 3 | -59/+106 |
| | | | | | | | | | | | | | | | | | | | | DIF_INSTALLDEVICE returns almost immediately, while the device installation continues in the background. It might take a while, before all registry keys and values are populated. Previously, wireguard-go waited for HKLM\SYSTEM\CurrentControlSet\ Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\<id> registry key only. Followed by a SetInterfaceName() method of Wintun struct which tried to access HKLM\SYSTEM\CurrentControlSet\Control\Network\ {4D36E972-E325-11CE-BFC1-08002BE10318}\<id>\Connection registry key might not be available yet. This commit loops until both registry keys are available before returning from CreateInterface() function. Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | receive: squelch tear down error | Jason A. Donenfeld | 2019-03-07 | 1 | -1/+1 |
| | |||||
* | tun: linux: work out netpoll trick | Jason A. Donenfeld | 2019-03-07 | 1 | -54/+46 |
| | |||||
* | wintun: Resolve some of golint warnings | Simon Rozman | 2019-03-04 | 4 | -17/+33 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | Elaborate the failing step when forwarding errors on return | Simon Rozman | 2019-03-04 | 1 | -3/+3 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | Simplify reading NetCfgInstanceId from registry | Simon Rozman | 2019-03-04 | 1 | -8/+2 |
| | | | | | | | | As querying non-existing registry value and reading non-existing registry string value both return ERROR_FILE_NOT_FOUND, we can use later only. Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | Unify interface-specific network registry key open | Simon Rozman | 2019-03-04 | 1 | -10/+19 |
| | | | | Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | tun: import mobile particularities | Jason A. Donenfeld | 2019-03-04 | 5 | -7/+65 |
| | |||||
* | boundif: introduce API for socket binding | Jason A. Donenfeld | 2019-03-04 | 8 | -21/+155 |
| | |||||
* | global: begin modularization | Jason A. Donenfeld | 2019-03-03 | 44 | -109/+118 |
| | |||||
* | tun: windows: expose GUID | Jason A. Donenfeld | 2019-03-01 | 1 | -0/+4 |
| | |||||
* | tun: allow special methods in NativeTun | Jason A. Donenfeld | 2019-03-01 | 6 | -65/+65 |
| | |||||
* | 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 | 6 | -138/+39 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | 6 | -55/+80 |
| | |||||
* | Rearrange imports | Jason A. Donenfeld | 2019-02-22 | 3 | -3/+3 |
| | |||||
* | device: send persistent keepalive when bringing up device | Jason A. Donenfeld | 2019-02-22 | 1 | -0/+3 |
| | | | | Reported-by: Marcelo Bello | ||||
* | wintun: Read/write packet size from/to exchange buffer directly | Simon Rozman | 2019-02-22 | 1 | -3/+3 |
| | | | | | | Driver <-> user-space communication is local and using native endian. Signed-off-by: Simon Rozman <simon@rozman.si> | ||||
* | wintun: Make two-step slicing a one step | Simon Rozman | 2019-02-22 | 1 | -3/+3 |
| | | | | | | | Stop relying to Go compiler optimizations and calculate the end offset directly. Signed-off-by: Simon Rozman <simon@rozman.si> |