aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* wg-quick: add darwin implementationJason A. Donenfeld2018-05-151-0/+444
| | | | | | It's pretty rough and leaves much to be desired, but it works. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: add wg symlinkJason A. Donenfeld2018-05-141-0/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: add android implementationJason A. Donenfeld2018-05-141-0/+666
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: reorganize for multiplatform wg-quickJason A. Donenfeld2018-05-145-7/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: preliminary support for go implementationJason A. Donenfeld2018-05-101-1/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: account for specified fwmark in auto routing modeJason A. Donenfeld2018-04-151-19/+23
| | | | | | | | | | | | If we're doing automatic routing with default routes, but the config has also specified an explicit fwmark, then use that explicit fwmark, even if it's conflicting, since the administrator has explicitly opted into using it. Also, when shutting down the interface, we only now remove the fancy rules if we're in automatic routing mode with default routes. Suggested-by: Luis Ressel <aranea@aixah.de> Reported-by: Saeid Akbari <saeidscorp@yahoo.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick.8: fix typoJason A. Donenfeld2018-04-041-1/+1
| | | | | Reported-by: Mike Pechkin <mike.pechkin@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: hide errors on saveJason A. Donenfeld2018-03-041-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: if resolvconf/run/iface exists, use itJason A. Donenfeld2018-03-041-1/+1
| | | | | | | Some older broken resolvconfs don't support resolvconf -l, but do have a file in a standard location, so use it. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: if resolvconf/interface-order exists, use itJason A. Donenfeld2018-03-041-3/+12
| | | | | | | | | Some older broken resolvconf implementations ignore -m, but do have an interface-order list. It's better to use this list dynamically, in case it changes, or in case it's not used by the OS's resolvconf implementation, such as in the case of systemd or openresolv. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: in gnu code, use un-underscored asmJason A. Donenfeld2018-03-022-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: fixup errno handlingJason A. Donenfeld2018-02-172-8/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: FreeBSD doesn't have EAI_NODATAJason A. Donenfeld2018-02-171-2/+15
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: do not collide types with libc clashesJason A. Donenfeld2018-02-171-4/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg(8): clarify phrasingJason A. Donenfeld2018-02-171-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: allow in-line commentsJason A. Donenfeld2018-02-173-11/+17
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: normalize strncpy/snprintf usageJason A. Donenfeld2018-02-144-18/+22
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: match from beginning rather than shift rightJason A. Donenfeld2018-02-061-2/+2
| | | | | | | Before, this meant that it simply took the last 15 characters, instead of erroring out when there's more than 15 chars. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: endian.h is not portableJason A. Donenfeld2018-02-051-4/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* curve25519: replace fiat64 with faster hacl64Jason A. Donenfeld2018-02-011-3/+3
| | | | | | | This reverts commit da4ff396cc5d5e0ff21f9ecbc2f951c048c63fff and adds some optimizations to hacl64. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* curve25519: replace hacl64 with fiat64Jason A. Donenfeld2018-02-011-8/+3
| | | | | | | | | | | | For now, it's faster: hacl64: 109782 cycles per call fiat64: 108984 cycles per call It's quite possible this commit will be reverted with nice changes from INRIA, though. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: dedup secret normalizationJason A. Donenfeld2018-01-311-7/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: fread doesn't change errnoJason A. Donenfeld2018-01-301-4/+0
| | | | | | | Thus we might be responding to an old errno, which could cause this to unnecessarily fail. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: share curve25519 implementations with kernelJason A. Donenfeld2018-01-231-1539/+30
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* curve25519-fiat32: uninline certain functionsJason A. Donenfeld2018-01-181-4/+4
| | | | | | | | | | While this has a negative performance impact on x86_64, it has a positive performance impact on smaller machines, which is where we're actually using this code. For example, an A53: Before: fiat32: 228605 cycles per call After: fiat32: 188307 cycles per call Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: import new curve25519 implementationsJason A. Donenfeld2018-01-181-1129/+1423
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg: plug memleak in config error pathJason A. Donenfeld2018-01-181-0/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: ifnames have max len of 15Jason A. Donenfeld2018-01-102-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: year bumpJason A. Donenfeld2018-01-0325-25/+25
| | | | 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>
* global: add SPDX tags to all filesGreg Kroah-Hartman2017-12-0925-50/+89
| | | | | | | | | | | | | | 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>
* 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-101-2/+2
| | | | 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>
* 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-311-0/+2
| | | | 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>