aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* timers: it is always reasonable to remove a timerJason A. Donenfeld2018-10-273-17/+6
| | | | | | | | | | | | | | | | If struct timer_list has not been setup, it is zeroed, in which case timer_pending is false, so calling del_timer is safe. Calling del_timer is also safe on a timer that has already been del_timer'd. And calling del_timer is safe after a peer is dead, since the whole point of it being dead is that no more timers are created and all contexts eventually stop. Finally del_timer uses a lock, which means it's safe to call it concurrently. Therefore, we do not need any guards around calls to del_timer. While we're at it, we can get rid of the old lingering timers_enabled boolean which wasn't doing anything anyway anymore. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ratelimiter: make hash calls explicitJason A. Donenfeld2018-10-271-11/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* makefile: include selftests in style checkJason A. Donenfeld2018-10-271-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* timers: do not use wg_peer_get_maybe_zeroJason A. Donenfeld2018-10-271-35/+13
| | | | | | | | | | | peer_remove calls sets is_dead to true and calls timers_stop before putting the last reference, which means whenever timers do actually trigger, they should only trigger with a reference, and therefore we don't need the maybe_zero dance. This also narrows the scope of using maybe_zero to just be lookup structures (the two hashtables and allowedips), which is what the idiom is actually meant for. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: fix sparse warnings in optional selftestsJason A. Donenfeld2018-10-271-12/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* poly1305-donna64: mark large constants as ULLJason A. Donenfeld2018-10-271-24/+24
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* send: consider dropped stage packets to be droppedJason A. Donenfeld2018-10-275-4/+15
| | | | | Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: fix up macros and annotationsJason A. Donenfeld2018-10-251-63/+70
| | | | | Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ratelimiter: refcounter doesn't need to be atomicJason A. Donenfeld2018-10-251-4/+4
| | | | | Suggested-by: Jann Horn <jann@thejh.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: do not allow compiler to reorder is_valid or is_deadJason A. Donenfeld2018-10-254-14/+17
| | | | | Suggested-by: Jann Horn <jann@thejh.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* peer: another peer_remove cleanupJason A. Donenfeld2018-10-252-12/+42
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bump snapshotJason A. Donenfeld2018-10-182-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* main: get rid of unloaded debug messageJason A. Donenfeld2018-10-101-1/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: give if statements brackets and other cleanupsJason A. Donenfeld2018-10-0910-27/+40
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* main: change module descriptionJason A. Donenfeld2018-10-081-1/+1
| | | | | Suggested-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* device: use textual error labels alwaysJason A. Donenfeld2018-10-081-22/+23
| | | | | Suggested-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: swap endianness early onArnd Bergmann2018-10-081-6/+9
| | | | | | | | | Otherwise if gcc's optimizer is able to look far in but not overly far in, we wind up with "warning: 'key' may be used uninitialized in this function [-Wmaybe-uninitialized]". Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* timers: avoid using control statements in macroJason A. Donenfeld2018-10-081-8/+23
| | | | | Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: remove control statement from macro by rewritingJason A. Donenfeld2018-10-081-67/+118
| | | | | | | | This is a significant rearrangement that makes things less clear, to satisfy a checkpatch.pl requirement. Suggested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: more nitsJason A. Donenfeld2018-10-0817-83/+91
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: rename struct wireguard_ to struct wg_Jason A. Donenfeld2018-10-0822-231/+220
| | | | | | | This required a bit of pruning of our christmas trees. Suggested-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* netlink: do not stuff index into nla typeJason A. Donenfeld2018-10-082-24/+17
| | | | | | | | 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> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: kill after 20 minutesJason A. Donenfeld2018-10-081-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: look in Kbuild and Makefile since they differ based on archJason A. Donenfeld2018-10-081-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: prefix functions used in callbacks with wg_Jason A. Donenfeld2018-10-089-90/+95
| | | | | Suggested-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: don't output for grep errorsDavide Garberi2018-10-071-2/+2
| | | | | | | | | This will make it so that kernels not having arch/$(SRCARCH)/Kbuild no longer give any (non-fatal) grep errors such as "grep: arch/arm64/Kbuild: No such file or directory". Signed-off-by: Davide Garberi <dade.garberi@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bump snapshotJason A. Donenfeld2018-10-072-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: style nitsJason A. Donenfeld2018-10-075-32/+30
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* crypto: clean up remaining .h->.cJason A. Donenfeld2018-10-079-11/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: document additional nobsJason A. Donenfeld2018-10-071-0/+12
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* makefile: do more generic wildcard so as to avoid rename issuesJason A. Donenfeld2018-10-072-2/+2
| | | | | | | | Commit ad5e4210 (global: rename include'd C files to be .c) breaks install target for dkms sources. Fix installing selftest/*.c. Suggested-by: Christian Hesse <mail@eworm.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* crypto: use BIT(i) & bitmap instead of (bitmap >> i) & 1Jason A. Donenfeld2018-10-071-2/+2
| | | | | | | | | | | | Pros: clearer if you're not familiar with the shift idiom, uses kernel macro. Cons: doesn't work any more if the lvalue ever ceases to be a bool. Neutral: generates the same machine code. Suggested-by: Sultan Alsawaf <sultanxda@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* crypto: disable broken implementations in selftestsJason A. Donenfeld2018-10-071-9/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: clang cannot handle __builtin_constant_pJason A. Donenfeld2018-10-071-0/+7
| | | | | | | | Or, put differently, we don't want to go chasing down random versions of clang used by XDA users, so we just disable this checking on clang all together. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: make asm/simd.h conditional on its existenceJason A. Donenfeld2018-10-075-23/+24
| | | | | | Android kernels backported it, complicating things. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: account for ancient ARM assemblerJason A. Donenfeld2018-10-061-0/+25
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bump snapshotJason A. Donenfeld2018-10-062-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* crypto: test all SIMD combinationsJason A. Donenfeld2018-10-0620-40/+82
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: rename include'd C files to be .cJason A. Donenfeld2018-10-0625-34/+34
| | | | | | | | | | This is done by 259 other files in the kernel tree: linux $ rg '#include.*\.c' -l | wc -l 259 Suggested-by: Sultan Alsawaf <sultanxda@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: remove ifdefs in favor of IS_ENABLEDJason A. Donenfeld2018-10-062-20/+34
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* curve25519-arm: rearrange multiplications for better in-order performanceJason A. Donenfeld2018-10-041-12/+12
| | | | | Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* curve25519-arm: writeback to base register when possibleJason A. Donenfeld2018-10-041-58/+27
| | | | | Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* blake2s: always put a simd, even if not use()'dJason A. Donenfeld2018-10-031-2/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* simd: introduce useful disabling macroJason A. Donenfeld2018-10-033-3/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Kconfig: do now allow IPV6=m,WG=yJason A. Donenfeld2018-10-031-0/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* curve25519-arm: adjust commentJason A. Donenfeld2018-10-031-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* curve25519-arm: use new simd apiJason A. Donenfeld2018-10-031-6/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* chacha20-arm: use proper reteq macro instead of bxeqJason A. Donenfeld2018-10-021-1/+2
| | | | | Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: show more messages in console the right wayJason A. Donenfeld2018-10-021-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: support powerpc64leJason A. Donenfeld2018-10-022-2/+22
| | | | | | | This uses ELFv2 ABI, which is the only ppc64 ABI musl supports. Big endian uses ELFv1 ABI, which musl doesn't support. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>