aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* wg-quick: save all hooks on saveJason A. Donenfeld2017-11-011-5/+13
|
* wg-quick: fsync the temporary file before renamingJason A. Donenfeld2017-10-311-0/+1
| | | | | | | This ensures that on an unclean shutdown, we either see the old content or the new content, but not empty content. Suggested-by: Ka Ho Ng <ngkaho1234@gmail.com>
* wg-quick: allow for saving existing interfaceJason A. Donenfeld2017-10-312-2/+14
|
* tools: correct type for CTRL_ATTR_FAMILY_IDJason A. Donenfeld2017-10-311-4/+4
| | | | Suggested-by: Jörg Thalheim <joerg@thalheim.io>
* wg-quick: allow for the hatchet, but not by defaultJason A. Donenfeld2017-10-311-0/+2
|
* wg-quick: remember to rewind DNS settings on failureJason A. Donenfeld2017-10-311-3/+8
|
* wg-quick: allow specifiying multiple hooksJason A. Donenfeld2017-10-312-18/+21
|
* global: style nitsJason A. Donenfeld2017-10-3110-110/+201
|
* global: infuriating kernel iterator styleJason A. Donenfeld2017-10-314-19/+19
| | | | | | | | | | | | | | | | | One types: for (i = 0 ... So one should also type: for_each_obj (obj ... But the upstream kernel style guidelines are insane, and so we must instead do: for_each_obj(obj ... Ugly, but one must choose his battles wisely.
* tools: account for padding being in zero attributeJason A. Donenfeld2017-10-171-0/+6
|
* tools: newline after warningJason A. Donenfeld2017-10-171-1/+1
|
* tools: styleJason A. Donenfeld2017-10-171-1/+1
|
* tools: add pass example to wg-quick man pageJason A. Donenfeld2017-10-171-22/+9
|
* tools: don't insist on having a private keyJason A. Donenfeld2017-10-171-5/+0
| | | | | | | | | | This lets us do flexible things from wg-quick such as: PostUp = wg set %i private-key <(pass WireGuard/private-keys/%i) It also was never a very sensible policy to enforce. Suggested-by: Luis Ressel <aranea@aixah.de>
* tools: retry resolution except when fatalJason A. Donenfeld2017-10-173-21/+23
| | | | | | | | | | | | | | | | | | | The reference to this is <https://sourceware.org/glibc/wiki/NameResolver>, which mentions: "From the perspective of the application that calls getaddrinfo() it perhaps doesn't matter that much since EAI_FAIL, EAI_NONAME and EAI_NODATA are all permanent failure codes and the causes are all permanent failures in the sense that there is no point in retrying later." This should cover more early-boot situations. While we're at it, we clean up the logic a bit so that we don't have a retry message on the final non-retrying attempt. We also peer into errno when receiving EAI_SYSTEM, to report to the user what actually happened. Also, fix the quoting back tick front tick mess.
* tools: encoding: be more paranoidJason A. Donenfeld2017-10-171-2/+2
| | | | Needless, but overkill can be fun.
* Makefile: even prettier outputJason A. Donenfeld2017-10-171-3/+3
|
* tools: man: include kill-switch documentation using fwmarkJason A. Donenfeld2017-10-111-0/+36
|
* tools: store tail pointer to make coalescing peers fastJason A. Donenfeld2017-10-102-74/+70
|
* tools: warn once on unrecognized itemsJason A. Donenfeld2017-10-092-0/+22
| | | | | | | | DaveM suggests we do in fact do this. Others on the same thread weren't happy about the length of the proposed message, so we also give a bit of a less dramatic warning. This reverts commit a2cc976a3b572cf308cc2d97c080eacac60416fe.
* tools: try again if dump is interruptedJason A. Donenfeld2017-10-081-1/+4
|
* Makefile: clang now builds the kernel, so use scan-buildJason A. Donenfeld2017-10-052-4/+1
| | | | | Also add little stub for coccinelle and clean up semicolon issue it found.
* Makefile: add non-verbose mode to toolsJason A. Donenfeld2017-10-031-1/+19
|
* global: satisfy bitshift pedantryJason A. Donenfeld2017-10-031-8/+8
| | | | Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
* tools: compile on non-LinuxJason A. Donenfeld2017-10-021-16/+22
|
* tools: simmer down silly compilersJason A. Donenfeld2017-10-021-1/+1
|
* tools: do not warn on unrecognized itemsJason A. Donenfeld2017-10-022-26/+0
| | | | Upstream advice is to simply be silent.
* wg-quick: check permissions of parent directoryJason A. Donenfeld2017-10-021-1/+1
| | | | | Also prefix octal 0, in case these files are actually of modes that don't start with 0 by accident (such as SUID or sticky bit).
* wg-quick: verify wireguard interface in more clever wayJason A. Donenfeld2017-10-021-1/+1
| | | | | This helps with old Debian which has ancient iproute2, as well as paving the path toward this script supporting userspace implementations.
* wg-quick: anchor sysctl regex to start and endJason A. Donenfeld2017-10-021-1/+1
| | | | | | | This doesn't actually fix a real problem, but it is more correct than not having it. Suggested-by: Aaron Sigel <aaron@vtty.com>
* netlink: switch from ioctl to netlink for configurationJason A. Donenfeld2017-10-0212-438/+1129
|
* tools: uapi: only make sure socket file is socketJason A. Donenfeld2017-09-261-4/+9
|
* tools: use key_is_zero for comparing to zerosJason A. Donenfeld2017-09-246-22/+24
| | | | | | | Maybe an attacker on the system could use the infoleak in /proc to gauge how long a wg(8) process takes to complete and determine the number of leading zeros. This is somewhat ridiculous, but it's possible somebody somewhere might at somepoint care in the future, so alright.
* wg-quick: only bash complete existing interfaces for downJason A. Donenfeld2017-09-061-12/+15
|
* tools: fix removal of pskJason A. Donenfeld2017-08-231-1/+1
| | | | This is an attribute of the peer, not the device.
* tools: stricter userspace ipc parsingJason A. Donenfeld2017-08-021-3/+3
|
* wg-quick: add explicit support for common DNS usageJason A. Donenfeld2017-07-262-12/+34
|
* wg-quick: do not use grepJason A. Donenfeld2017-07-241-1/+1
|
* wg-quick: do not set explicit src route for v6 default routeJason A. Donenfeld2017-07-241-11/+3
| | | | | | | | | This was only required because clueless network operators were trying to route fec0::/10 globally, when that range doesn't actually have global scope. Now that we understand the cause was operator error, we revert the change here, so that the routing table is kept consistent. This reverts commit 64e47de870a2f0575b5564a70e5680b48ab83ff9.
* wg-quick: usage typosJason A. Donenfeld2017-07-201-1/+2
|
* global: wireguard.io --> wireguard.comJason A. Donenfeld2017-07-203-6/+6
| | | | | Due to concerns with the .io TLD, we are switching to using wireguard.com instead.
* tools: remove double include in ipcJason A. Donenfeld2017-06-291-1/+0
|
* wg-quick: use printf -v instead of namerefs for bash 4.2Jason A. Donenfeld2017-06-281-3/+2
| | | | I'm not happy about this.
* wg-quick: properly match IPv6 endpointJason A. Donenfeld2017-06-241-1/+1
|
* tools: use proper __linux__ ifdefJason A. Donenfeld2017-06-121-1/+1
|
* wg-quick: match ipv6 default route more broadlyJason A. Donenfeld2017-06-121-1/+1
|
* wg-quick: make sure we have empty table for both v6 and v4Jason A. Donenfeld2017-06-111-1/+3
| | | | | | | Otherwise, we wind up not doing the right thing in the v6-only case, or doing something totally borked when v4 and v6 are filled unevenly. Reported-by: Roelf Wichertjes <contact@roelf.org>
* tools: allow creating device with no peersJason A. Donenfeld2017-05-311-4/+0
|
* man: update wg-quick(8) to show Debian resolvconf braindamageJason A. Donenfeld2017-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | While OpenResolv supports explicit ordering directives such as `-m` and exclusivity directives such as `-x`, Debian's own resolvconf supports none of this, instead using a hard coded list of interface name templates for determining ordering. While trying to emulate `-x` is difficult [*], we can at least try to mostly emulate `-m 0` by masquerading as a `tun*` interface to resolvconf. Ugly, but it works. [*] One heavy handed way of emulating `-x` would be something like: # echo nameserver 8.8.8.8 > /etc/resolv.conf.wg0-exclusive # mount --bind -o ro /etc/resolv.conf.wg0-exclusive /etc/resolv.conf # rm -f /etc/resolv.conf.wg0-exclusive This in practice works quite well, but is a bit heavy to put in a man page. It also doesn't "stack" well. For example, if we simply run `umount /etc/resolv.conf`, how do we know which resolv.conf entry we're unmounting?
* wg-quick: use src routing for default routes in v6Jason A. Donenfeld2017-05-181-3/+11
| | | | | Otherwise, traffic is sent with the IP address of a different interface, and then packets don't actually get delivered.