summaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: prefer sizeof(*pointer) when possibleJason A. Donenfeld2018-09-041-10/+6
| | | | Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
* crypto: import zincJason A. Donenfeld2018-09-031-1/+1
|
* global: run through clang-formatJason A. Donenfeld2018-08-281-67/+136
| | | | | | | This is the worst commit in the whole repo, making the code much less readable, but so it goes with upstream maintainers. We are now woefully wrapped at 80 columns.
* crypto: move simd context to specific typeJason A. Donenfeld2018-08-061-6/+6
| | | | Suggested-by: Andy Lutomirski <luto@kernel.org>
* send: switch handshake stamp to an atomicJason A. Donenfeld2018-08-041-11/+9
| | | | | | | | | | | Rather than abusing the handshake lock, we're much better off just using a boring atomic64 for this. It's simpler and performs better. Also, while we're at it, we set the handshake stamp both before and after the calculations, in case the calculations block for a really long time waiting for the RNG to initialize. Otherwise it's possible that when the RNG finally initializes, two handshakes are sent back to back, which isn't sensible.
* peer: ensure destruction doesn't raceJason A. Donenfeld2018-08-031-14/+20
| | | | | Completely rework peer removal to ensure peers don't jump between contexts and create races.
* queueing: ensure strictly ordered loads and storesJason A. Donenfeld2018-08-021-1/+1
| | | | | | | We don't want a consumer to read plaintext when it's supposed to be reading ciphertext, which means we need to synchronize across cores. Suggested-by: Jann Horn <jann@thejh.net>
* send: address of variable is never nullJason A. Donenfeld2018-07-311-1/+1
| | | | Reported-by: Jann Horn <jann@thejh.net>
* peer: simplify rcu reference countsJason A. Donenfeld2018-07-311-2/+2
| | | | | | | Use RCU reference counts only when we must, and otherwise use a more reasonably named function. Reported-by: Jann Horn <jann@thejh.net>
* global: use fast boottime instead of normal boottimeJason A. Donenfeld2018-06-231-2/+2
| | | | Generally if we're inaccurate by a few nanoseconds, it doesn't matter.
* global: use ktime boottime instead of jiffiesJason A. Donenfeld2018-06-231-7/+6
| | | | | | | | Since this is a network protocol, expirations need to be accounted for, even across system suspend. On real systems, this isn't a problem, since we're clearing all keys before suspend. But on Android, where we don't do that, this is something of a problem. So, we switch to using boottime instead of jiffies.
* global: fix a few typosJonathan Neuschäfer2018-06-221-1/+1
| | | | Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
* simd: encapsulate fpu amortization into nice functionsJason A. Donenfeld2018-06-171-7/+4
|
* queueing: re-enable preemption periodically to lower latencyJason A. Donenfeld2018-06-161-0/+6
|
* queueing: remove useless spinlocks on scJason A. Donenfeld2018-06-161-2/+0
| | | | Since these are the only consumers, there's no need for locking.
* timers: clear send_keepalive timer on sending handshake responseJason A. Donenfeld2018-05-191-0/+3
| | | | | | We reorganize this into also doing so on sending keepalives itself, which means the state machine is much more consistent, even if this was already implied.
* send: simplify skb_padding with nice macroJason A. Donenfeld2018-04-161-4/+3
|
* send: account for route-based MTUJason A. Donenfeld2018-04-151-3/+4
| | | | | | | | | | It might be that a particular route has a different MTU than the interface, via `ip route add ... dev wg0 mtu 1281`, for example. In this case, it's important that we don't accidently pad beyond the end of the MTU. We accomplish that in this patch by carrying forward the MTU from the dst if it exists. We also add a unit test for this issue. Reported-by: Roman Mamedov <rm.wg@romanrm.net>
* global: year bumpJason A. Donenfeld2018-01-031-1/+1
|
* global: add SPDX tags to all filesGreg Kroah-Hartman2017-12-091-1/+4
| | | | | | | | | | | | | 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>
* global: style nitsJason A. Donenfeld2017-10-311-6/+12
|
* global: infuriating kernel iterator styleJason A. Donenfeld2017-10-311-5/+5
| | | | | | | | | | | | | | | | | 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.
* global: accept decent check_patch.pl suggestionsJason A. Donenfeld2017-10-311-3/+4
|
* stats: more robust accountingJason A. Donenfeld2017-10-311-0/+1
|
* send: improve dead packet control flowJason A. Donenfeld2017-10-171-6/+3
|
* send: do not requeue if packet is deadJason A. Donenfeld2017-10-111-1/+6
|
* queueing: cleanup skb_paddingJason A. Donenfeld2017-10-051-0/+14
|
* queueing: move from ctx to cbJason A. Donenfeld2017-10-051-54/+49
|
* queueing: use ptr_ring instead of linked listsJason A. Donenfeld2017-10-051-6/+15
|
* send: put keypair referenceJason A. Donenfeld2017-10-051-0/+1
|
* global: add space around variable declarationsJason A. Donenfeld2017-10-031-0/+1
|
* queueing: rename cpumask functionJason A. Donenfeld2017-09-191-1/+1
|
* send: don't take uninitialized lockJason A. Donenfeld2017-09-191-3/+3
| | | | | | Packets is a local, which means we need to use the functions that don't take a spinlock, since otherwise we'll be using a spinlock in an undefined state.
* queueing: no need to memzero structJason A. Donenfeld2017-09-191-1/+2
|
* queue: entirely rework parallel systemJason A. Donenfeld2017-09-181-60/+174
| | | | | | | | | | This removes our dependency on padata and moves to a different mode of multiprocessing that is more efficient. This began as Samuel Holland's GSoC project and was gradually reworked/redesigned/rebased into this present commit, which is a combination of his initial contribution and my subsequent rewriting and redesigning.
* send: no need to check for NULL since ref is validJason A. Donenfeld2017-09-161-3/+0
|
* noise: infer initiator or not from handshake stateJason A. Donenfeld2017-08-041-1/+1
| | | | Suggested-by: Mathias Hall-Andersen <mathias@hall-andersen.dk>
* timers: rename confusingly named functions and variablesJason A. Donenfeld2017-08-041-1/+1
| | | | Suggested-by: Mathias Hall-Andersen <mathias@hall-andersen.dk>
* send: use skb_queue_empty where appropriateSamuel Holland2017-07-201-3/+3
| | | | Signed-off-by: Samuel Holland <samuel@sholland.org>
* global: use pointer to net_deviceJason A. Donenfeld2017-07-201-5/+5
| | | | | | DaveM prefers it to be this way per [1]. [1] http://www.spinics.net/lists/netdev/msg443992.html
* send: orphan skbs when buffering longtermJason A. Donenfeld2017-07-201-1/+7
| | | | | | | | | Otherwise we quickly use up all of a socket's memory, which prevents a socket from sending packets to other interfaces. This also has the nice effect of letting TCP connections continue to attempt to begin, with the older ones being naturally rotated out and freed, so when a connection finally is made, only the later TCP connections are attempted, not the ones that would already have timed out.
* timers: reset retry-attempt counter when not retryingJason A. Donenfeld2017-05-311-3/+6
|
* debug: print interface name in dmesgJason A. Donenfeld2017-05-311-4/+4
|
* style: spaces after for loopsJason A. Donenfeld2017-05-301-1/+1
|
* handshake: process in parallelJason A. Donenfeld2017-05-301-1/+1
|
* data: cleanup parallel workqueue and use two max_activeJason A. Donenfeld2017-04-081-1/+1
|
* data: simplify flowJason A. Donenfeld2017-04-041-2/+2
|
* locking: always use _bhJason A. Donenfeld2017-04-041-10/+9
| | | | | All locks are potentially between user context and softirq, which means we need to take the _bh variant.
* data: big refactoringJason A. Donenfeld2017-03-201-3/+6
|
* Update copyrightJason A. Donenfeld2017-01-101-1/+1
|