aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* wg-quick: android: use Binder for setting DNS on Android 10nd/android-10-dnsNicolas Douma2019-10-125-0/+647
| | | | Signed-off-by: Nicolas Douma <nicolas@serveur.io>
* wg-quick: android: add addresses after bringing interface upNicolas Douma2019-10-021-1/+1
| | | | Signed-off-by: Nicolas Douma <nicolas@serveur.io>
* tools: windows: enforce named pipe ownership and use protected prefixJason A. Donenfeld2019-08-312-22/+40
|
* wg-quick: linux: don't fail down when using systemd-resolvedRonan Pigott2019-08-271-1/+1
| | | | | | | | | | | | | | | | systemd-resolved has a compatibility interface for use with resolvconf scripts when resolvectl is called from a symlink from resolvconf. However, when tearing down the interface, cmd_down calls del_if and then unset_dns. In the case of systemd-resolved, deleting the interface also removes the systemd-resolved entry and causes resolvconf -d to fail when resolvconf really is a symlink to resolvectl. This causes `wg-quick down` and 'wg-quick@.service' to exit with failure. Instead we use the resolvconf '-f' flag to ignore non-existent interfaces, supported by both openresolv and sd-resolved resolvconf. Signed-off-by: Ronan Pigott <rpigott@berkeley.edu> [zx2c4: moved -f argument to end to remain compatible with Debian's resolvconf]
* wg-quick: openbsd: fix alternate routing table syntaxAnkur Kothari2019-08-071-1/+1
| | | | | | | route(8) has always used the `-T` option to specify the routing table; there is no `rdomain` option. Signed-off-by: Ankur Kothari <ankur@lipidity.com>
* wg-quick: android: refactor and add incoming allow rulesJason A. Donenfeld2019-07-081-65/+73
| | | | Suggested-by: Yağmur Oymak <yagmur.oymak@gmail.com>
* wg-quick: darwin: support being called from launchdJason A. Donenfeld2019-06-241-1/+16
| | | | | | | This causes wg-quick up to wait for the monitor to exit before it exits, so that launchd can correctly wait on it. Reported-by: Cameron Palmer <cameron@promon.no>
* tools: pass WG_ENDPOINT_RESOLUTION_RETRIES=infinity to systemd unitJason A. Donenfeld2019-05-311-0/+1
|
* tools: add wincompat layer to wg(8)Jason A. Donenfeld2019-05-3115-0/+321
|
* tools: allow setting WG_ENDPOINT_RESOLUTION_RETRIESJason A. Donenfeld2019-05-292-4/+25
|
* wg-quick: specify protocol to ip(8), because of inconsistenciesJason A. Donenfeld2019-05-291-3/+7
|
* wg-quick: look up existing routes properlyJason A. Donenfeld2019-05-291-1/+1
| | | | | | This was never really correct, and then 5.1 broke it entirely. Reported-by: piraty1@inbox.ru
* wg-quick: make darwin and freebsd path search strict like linuxJason A. Donenfeld2019-04-232-2/+4
|
* wg-quick: freebsd: workaround SIOCGIFSTATUS race in FreeBSD kernelJason A. Donenfeld2019-04-231-9/+22
|
* tools: avoid unneccessary next_peer assignments in sort_peers()Luis Ressel2019-03-231-2/+1
| | | | Signed-off-by: Luis Ressel <aranea@aixah.de>
* wg-quick: add 'strip' subcommandLuis Ressel2019-03-235-5/+50
| | | | | | | | | `wg-quick strip` prints the config file to stdout after stripping it of all wg-quick-specific options. This enables tricks such as `wg addconf $DEV <(wg-quick strip $DEV)`. Signed-off-by: Luis Ressel <aranea@aixah.de>
* tools: warn if an AllowedIP has a nonzero host partLuis Ressel2019-03-231-0/+34
| | | | Signed-off-by: Luis Ressel <aranea@aixah.de>
* wg-quick: freebsd: export TMPDIR when restoring and don't make emptyJason A. Donenfeld2019-03-181-1/+2
| | | | Otherwise mktemp doesn't see it, and if it's empty we wind up in /.
* tools: add support for HaikuAlexander von Gluck IV2019-02-281-0/+3
| | | | Signed-off-by: Alexander von Gluck IV <kallisti5@unixzen.com>
* tools: genkey: account for short reads of /dev/urandomJason A. Donenfeld2019-02-281-12/+24
| | | | | | | | | | Apparently Haiku has a misbehaving /dev/urandom. While we're at it, simplify the function signature to completely succeed or completely fail and make sure the caller checks the result. Reported-by: Alexander von Gluck IV <kallisti5@unixzen.com> Nitpicked-by: Aaron Jones <aaronmdjones@gmail.com>
* wg-quick: freebsd: rebreak interface loopback, while fixing localhostJason A. Donenfeld2019-02-281-1/+1
| | | | | | | | | | | The commit 7c833642 ("wg-quick: freebsd: allow loopback to work") was supposed to make things better, but actually it just started sending legitimate localhost traffic over the WireGuard interface, which is really quite bad. This reverts commit 7c833642dfa342218602ab18e7091e86408d2982. Reported-by: Matt Smith <matt.xtaz@gmail.com>
* tools: c_acc doesn't need to be initializedJason A. Donenfeld2019-02-081-1/+1
|
* tools: fight compiler slightly harderJason A. Donenfeld2019-02-052-2/+2
|
* noise: store clamped key instead of raw keyJason A. Donenfeld2019-02-032-4/+2
|
* systemd: wg-quick should depend on nss-lookup.targetJason A. Donenfeld2019-01-301-2/+2
| | | | | | | Since wg-quick(8) calls wg(8) which does hostname lookups, we should probably only run this after we're allowed to look up hostnames. Reported-by: Anton Castelli <anton.c42@gmail.com>
* tools: remove unused check phony declarationJason A. Donenfeld2019-01-241-1/+1
|
* wg-quick: freebsd: allow loopback to workJason A. Donenfeld2019-01-241-1/+1
| | | | | | | | | | | | FreeBSD adds a route for point-to-point destination addresses. We don't really want to specify any destination address, but unfortunately we have to. Before we tried to cheat by giving our own address as the destination, but this had the unfortunate effect of preventing loopback from working on our local ip address. We work around this with yet another kludge: we set the destination address to 127.0.0.1. Since 127.0.0.1 is already assigned to an interface, this has the same effect of not specifying a destination address, and therefore we accomplish the intended behavior.
* netlink: use __kernel_timespec for handshake timeJason A. Donenfeld2019-01-233-4/+10
|
* global: normalize -> clampJason A. Donenfeld2019-01-233-3/+3
|
* global: update copyrightJason A. Donenfeld2019-01-0729-29/+29
|
* tools: curve25519: handle unaligned loads/stores safelyJason A. Donenfeld2018-12-202-5/+19
| | | | Reported-by: Chris Hewitt <chris@chrishewitt.net>
* wg-quick: bring interface up while setting MTUAaron Jones2018-12-181-9/+4
| | | | | | | This avoids another ip(8) invocation for little benefit. Confirmed to work with iproute2 and busybox. Signed-off-by: Aaron Jones <aaronmdjones@gmail.com>
* wg-quick: android: do not choke on empty allowed-ipsJason A. Donenfeld2018-11-111-1/+4
| | | | Reported-by: Samuel Holland <samuel@sholland.org>
* wg.8: AllowedIPs isn't actually requiredJason A. Donenfeld2018-10-191-1/+1
| | | | | | | An empty allowed IPs is totally valid, for folks wishing to move IP addresses between multiple peers atomically. Suggested-by: Comex <comexk@gmail.com>
* wg.8: specify that wg(8) shows runtime info tooJason A. Donenfeld2018-10-191-1/+1
| | | | Suggested-by: Comex <comexk@gmail.com>
* tools: wg-quick: wait for interface to disappear on freebsdJason A. Donenfeld2018-10-131-0/+9
|
* tools: don't fail if a netlink interface dump is inconsistentJason A. Donenfeld2018-10-131-2/+9
| | | | | | | | | | Netlink returns NLM_F_DUMP_INTR if the set of all tunnels changed during the dump. That's unfortunate, but is pretty common on busy systems that are adding and removing tunnels all the time. Rather than retrying, potentially indefinitely, we just work with the partial results. Reported-by: Robert Gerus <ar@is-a.cat>
* tools: compile on gnu99Jason A. Donenfeld2018-10-091-1/+1
| | | | | | | We don't actually use any C11 features, so we can at least compile with ancient gcc. Reported-by: Aaron M. D. Jones <aaronmdjones@gmail.com>
* tools: use libc's endianness macro if no compiler macroJason A. Donenfeld2018-10-091-0/+10
| | | | | | This lets us be compiled with ancient gcc. Reported-by: Jeff Brandt <jeff@jeffcolo.net>
* netlink: do not stuff index into nla typeJason A. Donenfeld2018-10-081-5/+4
| | | | | | | It's not used for anything, and LKML doesn't like the type being used as an index value. Suggested-by: Eugene Syromiatnikov <esyr@redhat.com>
* crypto: clean up remaining .h->.cJason A. Donenfeld2018-10-071-2/+2
|
* wg-quick.8: add policy routing exampleJason A. Donenfeld2018-10-051-0/+26
| | | | | Suggested-by: Toke Høiland-Jørgensen <toke@toke.dk> Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
* crypto: make constant naming scheme consistentJason A. Donenfeld2018-09-252-7/+7
|
* global: put SPDX identifier on its own lineJason A. Donenfeld2018-09-2022-44/+44
| | | | | The kernel has very specific rules correlating file type with comment type, and also SPDX identifiers can't be merged with other comments.
* global: prefer sizeof(*pointer) when possibleJason A. Donenfeld2018-09-043-13/+13
| | | | Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
* crypto: import zincJason A. Donenfeld2018-09-031-2/+2
|
* tools: ipc: do not warn on unrecognized netlink attributesJason A. Donenfeld2018-09-021-17/+0
| | | | It makes extending things more difficult.
* crypto: use unaligned helpersJason A. Donenfeld2018-08-281-0/+3
| | | | | | This is not useful for WireGuard, but for the general use case we probably want it this way, and the speed difference is mostly lost in the noise.
* wg-quick: check correct variable for route deduplicationJason A. Donenfeld2018-08-211-1/+1
| | | | Reported-by: John Sager <john@sager.me.uk>
* wg-quick: darwin: prefer system paths for toolsJason A. Donenfeld2018-08-121-1/+1
| | | | | | | | | | | | The only things wg-quick(8) needs from Homebrew are bash(1) and wg(8). Other than that, it's explicitly coded against the native system utilities. Since wg-quick(8) and bash(1) are invoked in auto_su by their full absolute path (via $SELF and $BASH, respectively), we can simply set the $PATH to be prefixed by the default system binary paths. This way, if users install tools that conflict with system tools -- such as GNU coreutils -- we won't accidently call those. Reported-by: Deirdre Connolly <durumcrustulum@gmail.com>