aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/peer.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: move to consistent use of uN instead of uintN_t for kernel codeJason A. Donenfeld2016-12-111-3/+3
|
* headers: cleanup noticesJason A. Donenfeld2016-11-211-1/+1
|
* socket: keep track of src address in sending packetsJason A. Donenfeld2016-11-151-1/+13
|
* data: we care about per-peer, not per-device, inflight encryptionsJason A. Donenfeld2016-11-061-0/+3
|
* c89: the static keyword is okay in c99, but not in c89Jason A. Donenfeld2016-11-051-1/+1
|
* compat: stub out dst_cache for old kernelsJason A. Donenfeld2016-11-041-0/+2
|
* socket: use dst_cache instead of handrolled cacheJason A. Donenfeld2016-11-041-5/+2
|
* timers: take reference like a lookup tableJason A. Donenfeld2016-11-031-0/+2
|
* timers: only have initiator rekeyJason A. Donenfeld2016-10-191-1/+2
| | | | | | | | | If it's time to rekey, and the responder sends a message, the initator will begin the rekeying when sending his response message. In the worst case, this response message will actually just be the keepalive. This generally works well, with the one edge case of the message arriving less than 10 seconds before key expiration, in which the keepalive is not sufficient. In this case, we simply rehandshake immediately.
* timers: always delay handshakes for responderJason A. Donenfeld2016-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the prior behavior, when sending a packet, we checked to see if it was about time to start a new handshake, and if we were past a certain time, we started it. For the responder, we made that time a bit further in the future than for the initiator, to prevent the thundering herd problem of them both starting at the same time. However, this was flawed. If both parties stopped communicating after 2.2 minutes, and then one party decided to initiate a TCP connection before the 3 minute mark, the currently open session would be used. However, because it was after the 2.2 minute mark, both peers would try to initiate a handshake upon sending their first packet. The errant flow was as follows: 1. Peer A sends SYN. 2. Peer A sees that his key is getting old and initiates new handshake. 3. Peer B receives SYN and sends ACK. 4. Peer B sees that his key is getting old and initiates new handshake. Since these events happened after the 2.2 minute mark, there's no delay between handshake initiations, and problems begin. The new behavior is changed to: 1. Peer A sends SYN. 2. Peer A sees that his key is getting old and initiates new handshake. 3. Peer B receives SYN and sends ACK. 4. Peer B sees that his key is getting old and schedules a delayed handshake for 12.5 seconds in the future. 5. Peer B receives handshake initiation and cancels scheduled handshake.
* send: requeue jobs for later if padata is fullJason A. Donenfeld2016-10-051-0/+1
|
* Rework headers and includesJason A. Donenfeld2016-09-291-1/+3
|
* c: specify static array size in function paramsJason A. Donenfeld2016-08-021-1/+1
| | | | | | | | | | | | | | | The C standard states: A declaration of a parameter as ``array of type'' shall be adjusted to ``qualified pointer to type'', where the type qualifiers (if any) are those specified within the [ and ] of the array type derivation. If the keyword static also appears within the [ and ] of the array type derivation, then for each call to the function, the value of the corresponding actual argument shall provide access to the first element of an array with at least as many elements as specified by the size expression. By changing void func(int array[4]) to void func(int array[static 4]), we automatically get the compiler checking argument sizes for us, which is quite nice.
* persistent keepalive: use unsigned long to avoid multiplication in hotpathJason A. Donenfeld2016-07-101-1/+1
|
* persistent keepalive: add kernel mechanismJason A. Donenfeld2016-07-081-1/+2
|
* Initial commitJason A. Donenfeld2016-06-251-0/+55