Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | device: change logging interface to use functions | Josh Bleecher Snyder | 2021-01-26 | 1 | -11/+10 |
| | | | | | | | | | | | | | | | | | | | | | This commit overhauls wireguard-go's logging. The primary, motivating change is to use a function instead of a *log.Logger as the basic unit of logging. Using functions provides a lot more flexibility for people to bring their own logging system. It also introduces logging helper methods on Device. These reduce line noise at the call site. They also allow for log functions to be nil; when nil, instead of generating a log line and throwing it away, we don't bother generating it at all. This spares allocation and pointless work. This is a breaking change, although the fix required of clients is fairly straightforward. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com> | ||||
* | main: now that we're upstreamed, relax Linux warning | Jason A. Donenfeld | 2020-05-02 | 1 | -12/+10 |
| | | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> | ||||
* | global: update header comments and modules | Jason A. Donenfeld | 2020-05-02 | 1 | -1/+1 |
| | | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> | ||||
* | main: simplify warnings | Jason A. Donenfeld | 2019-09-08 | 1 | -15/+1 |
| | |||||
* | tun: remove TUN prefix from types to reduce stutter elsewhere | Matt Layher | 2019-06-14 | 1 | -1/+1 |
| | | | | Signed-off-by: Matt Layher <mdlayher@gmail.com> | ||||
* | global: regroup all imports | Jason A. Donenfeld | 2019-05-14 | 1 | -3/+4 |
| | |||||
* | main: revise warnings | Jason A. Donenfeld | 2019-04-19 | 1 | -25/+15 |
| | |||||
* | global: begin modularization | Jason A. Donenfeld | 2019-03-03 | 1 | -15/+17 |
| | |||||
* | tun: use netpoll instead of rwcancel | Jason A. Donenfeld | 2019-02-27 | 1 | -0/+5 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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") } | ||||
* | Change package path | Jason A. Donenfeld | 2019-02-18 | 1 | -1/+1 |
| | |||||
* | Import windows scafolding | Jason A. Donenfeld | 2019-02-05 | 1 | -0/+2 |
| | |||||
* | Update copyright | Jason A. Donenfeld | 2019-02-05 | 1 | -2/+2 |
| | |||||
* | global: fix up copyright headers | Jason A. Donenfeld | 2018-09-16 | 1 | -2/+1 |
| | |||||
* | Print version number in log | Jason A. Donenfeld | 2018-05-30 | 1 | -0/+2 |
| | |||||
* | Catch EINTR | Jason A. Donenfeld | 2018-05-24 | 1 | -1/+1 |
| | |||||
* | Add undocumented --version flag | Jason A. Donenfeld | 2018-05-24 | 1 | -0/+5 |
| | |||||
* | 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 | -3/+4 |
| | |||||
* | Minor main.go signal fixes | Filippo Valsorda | 2018-05-21 | 1 | -2/+3 |
| | | | | | | | | * Buffer the signal channel as it's non-blocking on the sender side * Notify on SIGTERM instead of the uncatchable SIGKILL License: MIT Signed-off-by: Filippo Valsorda <valsorda@google.com> | ||||
* | Add copyright headers | Mathias Hall-Andersen | 2018-05-19 | 1 | -0/+1 |
| | |||||
* | Use /dev/null as place holder | Jason A. Donenfeld | 2018-05-14 | 1 | -0/+5 |
| | |||||
* | Ugly hack to suppress warning on backgrounded process | Jason A. Donenfeld | 2018-05-14 | 1 | -0/+4 |
| | |||||
* | Netlink sockets can't be shutdown | Jason A. Donenfeld | 2018-05-14 | 1 | -4/+0 |
| | |||||
* | Clean more | Jason A. Donenfeld | 2018-05-14 | 1 | -1/+1 |
| | |||||
* | Optional logging even in background | Jason A. Donenfeld | 2018-05-14 | 1 | -3/+10 |
| | |||||
* | Rewrite timers and related state machines | Jason A. Donenfeld | 2018-05-10 | 1 | -0/+15 |
| | |||||
* | Removed remaining signals from peer | Mathias Hall-Andersen | 2018-05-05 | 1 | -15/+0 |
| | | | | | | 1. Removed remaining signals from peer struct 2. Made needAnotherKeepalive local 3. Removed environment check from warning text (annoying when debugging) | ||||
* | Removed old signals | Mathias Hall-Andersen | 2018-05-05 | 1 | -1/+0 |
| | |||||
* | uapi: use kqueue for sock deletion on darwin | Jason A. Donenfeld | 2018-05-04 | 1 | -0/+4 |
| | |||||
* | tun: allow darwin to auto assign names | Jason A. Donenfeld | 2018-05-04 | 1 | -7/+15 |
| | |||||
* | warning: put into main | Jason A. Donenfeld | 2018-05-04 | 1 | -4/+41 |
| | |||||
* | global: Add SPDX tags and copyright header | Jason A. Donenfeld | 2018-05-03 | 1 | -0/+5 |
| | | | | Mathias should probably add his copyright headers to each file too. | ||||
* | Daemonize with environment variable | Jason A. Donenfeld | 2018-05-03 | 1 | -6/+19 |
| | |||||
* | Start to dust off Darwin | Jason A. Donenfeld | 2018-05-03 | 1 | -0/+2 |
| | |||||
* | We can determine the interface name ourselves | Jason A. Donenfeld | 2018-04-19 | 1 | -1/+1 |
| | |||||
* | Align with go library layout | Mathias Hall-Andersen | 2018-02-04 | 1 | -0/+196 |