aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* global: year bumpJason A. Donenfeld2018-01-0342-42/+42
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: dumber matching for default routesJason A. Donenfeld2017-12-131-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: add the "Table" config optionLuis Ressel2017-12-132-3/+18
| | | | | | | | | * Table=auto (default) selects the current behaviour * Table=off disables creation of routes altogether * All other values are passed through to "ip route add"'s table option Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* keygen-html: remove prebuilt fileJason A. Donenfeld2017-12-127-45/+42
| | | | | | | | We also reduce the optimization level, just in case, but add closure compiler into the mix. Suggested-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: add SPDX tags to all filesGreg Kroah-Hartman2017-12-0940-69/+147
| | | | | | | | | | | | | | It's good to have SPDX identifiers in all files as the Linux kernel developers are working to add these identifiers to all files. Update all files with the correct SPDX license identifier based on the license text of the project or based on the license in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Modified-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: no need to put this on the stackJason A. Donenfeld2017-12-031-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: remove undocumented unused syntaxJason A. Donenfeld2017-12-031-11/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* contrib: keygen-html for generating keys in the browserJason A. Donenfeld2017-12-034-0/+1020
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: fix removing preshared keysJason A. Donenfeld2017-11-231-69/+55
| | | | | | Also clean up related logic quite a bit and add unit tests. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: switch from timeval to timespecJason A. Donenfeld2017-11-223-7/+7
| | | | | | | | | | | | | | | | | | | | | This gets us nanoseconds instead of microseconds, which is better, and we can do this pretty much without freaking out existing userspace, which doesn't actually make use of the nano/micro seconds field: zx2c4@thinkpad ~ $ cat a.c void main() { puts(sizeof(struct timeval) == sizeof(struct timespec) ? "success" : "failure"); } zx2c4@thinkpad ~ $ gcc a.c -m64 && ./a.out success zx2c4@thinkpad ~ $ gcc a.c -m32 && ./a.out success This doesn't solve y2038 problem, but timespec64 isn't yet a thing in userspace. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: tighten up strtoul parsingJason A. Donenfeld2017-11-172-36/+62
| | | | | Reported-by: Cedric Buxin <cedric.buxin@izri.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: document localhost exception and v6 ruleJason A. Donenfeld2017-11-121-3/+4
| | | | | Reported-by: Hermann Lienstromberg <nurtic-vibe@grmml.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: allow for NULL keys everywhereJason A. Donenfeld2017-11-115-29/+50
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: remove ioctl cruftJason A. Donenfeld2017-11-111-4/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: allow for tabs in keysJason A. Donenfeld2017-11-102-20/+20
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: stat the correct enclosing folder of config fileJason A. Donenfeld2017-11-101-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: save all hooks on saveJason A. Donenfeld2017-11-011-5/+13
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* 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> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: allow for saving existing interfaceJason A. Donenfeld2017-10-312-2/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* contrib: add reresolve-dnsJason A. Donenfeld2017-10-312-0/+48
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: correct type for CTRL_ATTR_FAMILY_IDJason A. Donenfeld2017-10-311-4/+4
| | | | | Suggested-by: Jörg Thalheim <joerg@thalheim.io> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: allow for the hatchet, but not by defaultJason A. Donenfeld2017-10-314-0/+55
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: remember to rewind DNS settings on failureJason A. Donenfeld2017-10-311-3/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: allow specifiying multiple hooksJason A. Donenfeld2017-10-312-18/+21
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: style nitsJason A. Donenfeld2017-10-3110-110/+201
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* 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. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: account for padding being in zero attributeJason A. Donenfeld2017-10-171-0/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: newline after warningJason A. Donenfeld2017-10-171-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: styleJason A. Donenfeld2017-10-171-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: add pass example to wg-quick man pageJason A. Donenfeld2017-10-171-22/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: 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> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: 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. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: encoding: be more paranoidJason A. Donenfeld2017-10-171-2/+2
| | | | | | Needless, but overkill can be fun. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Makefile: even prettier outputJason A. Donenfeld2017-10-171-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: man: include kill-switch documentation using fwmarkJason A. Donenfeld2017-10-111-0/+36
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: store tail pointer to make coalescing peers fastJason A. Donenfeld2017-10-102-74/+70
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: 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. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: try again if dump is interruptedJason A. Donenfeld2017-10-081-1/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* 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. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Makefile: add non-verbose mode to toolsJason A. Donenfeld2017-10-031-1/+19
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: satisfy bitshift pedantryJason A. Donenfeld2017-10-031-8/+8
| | | | | Suggested-by: Sultan Alsawaf <sultanxda@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* contrib: remove worthless build artifactJason A. Donenfeld2017-10-021-0/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: compile on non-LinuxJason A. Donenfeld2017-10-021-16/+22
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: simmer down silly compilersJason A. Donenfeld2017-10-021-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: do not warn on unrecognized itemsJason A. Donenfeld2017-10-022-26/+0
| | | | | | Upstream advice is to simply be silent. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* 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). Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* 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. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* 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> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* netlink: switch from ioctl to netlink for configurationJason A. Donenfeld2017-10-0212-438/+1129
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: uapi: only make sure socket file is socketJason A. Donenfeld2017-09-261-4/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>