aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/netlink.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: always find OOM unlikelyJason A. Donenfeld2018-09-041-3/+3
| | | | Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
* global: prefer sizeof(*pointer) when possibleJason A. Donenfeld2018-09-041-5/+4
| | | | Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
* global: satisfy check_patch.pl errorsJason A. Donenfeld2018-09-031-18/+18
|
* netlink: insert peer version placeholderJason A. Donenfeld2018-09-021-2/+10
| | | | | | | While we don't want people to ever use old protocols, people will complain if the API "changes", so explicitly make the unset protocol mean the latest, and add a dummy mechanism of specifying the protocol on a per-peer basis, which we hope nobody actually ever uses.
* global: run through clang-formatJason A. Donenfeld2018-08-281-65/+150
| | | | | | | 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.
* netlink: don't start over iteration on multipart non-first allowedipsJason A. Donenfeld2018-08-091-2/+4
| | | | Reported-by: Matt Layher <mdlayher@gmail.com>
* peer: simplify rcu reference countsJason A. Donenfeld2018-07-311-3/+5
| | | | | | | 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 ktime boottime instead of jiffiesJason A. Donenfeld2018-06-231-2/+2
| | | | | | | | 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.
* netlink: maintain static_identity lock over entire private key updateJason A. Donenfeld2018-06-181-0/+2
| | | | | We don't want the local private key to not correspond with a precomputed ss or precomputed cookie hash at any intermediate point.
* global: year bumpJason A. Donenfeld2018-01-031-1/+1
|
* compat: kernels < 3.13 modified genl_opsJason A. Donenfeld2017-12-211-1/+6
|
* 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>
* netlink: rename symbol to avoid clashesJason A. Donenfeld2017-11-291-2/+2
| | | | At somepoint we may need to wg_ namespace these.
* compat: support 4.15's netlink and barrier changesJason A. Donenfeld2017-11-261-1/+1
|
* global: switch from timeval to timespecJason A. Donenfeld2017-11-221-2/+2
| | | | | | | | | | | | | | | | | | | 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.
* socket: only free socket after successful creation of newJason A. Donenfeld2017-11-171-4/+4
| | | | | | | | | | | | | | When an interface is down, the socket port can change freely. A socket will be allocated when the interface comes up, and if a socket can't be allocated, the interface doesn't come up. However, a socket port can change while the interface is up. In this case, if a new socket with a new port cannot be allocated, it's important to keep the interface in a consistent state. The choices are either to bring down the interface or to preserve the old socket. This patch implements the latter. Reported-by: Marc-Antoine Perennou <keruspe@exherbo.org>
* curve25519: reject deriving from NULL private keysJason A. Donenfeld2017-11-111-7/+9
| | | | | These aren't actually valid 25519 points pre-normalization, and doing this is required to make unsetting private keys based on all zeros.
* allowedips: rename from routingtableJason A. Donenfeld2017-11-101-8/+8
| | | | Makes it more clear that this _not_ a routing table replacement.
* netlink: plug memory leakJason A. Donenfeld2017-11-031-1/+1
|
* compat: unbreak unloading on kernels 4.6 through 4.9Jason A. Donenfeld2017-11-011-1/+4
|
* global: style nitsJason A. Donenfeld2017-10-311-4/+7
|
* global: infuriating kernel iterator styleJason A. Donenfeld2017-10-311-6/+6
| | | | | | | | | | | | | | | | | 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.
* peer: get rid of peer_for_each magicJason A. Donenfeld2017-10-311-5/+5
| | | | | | | | | Since the peer list is protected by the device_update_lock, and since items are removed from the peer list before putting their final reference, we don't actually need to take a reference when iterating. This allows us to simplify the macro considerably. Suggested-by: Johannes Berg <johannes@sipsolutions.net>
* global: accept decent check_patch.pl suggestionsJason A. Donenfeld2017-10-311-0/+7
|
* compat: just make ro_after_init read_mostlyJason A. Donenfeld2017-10-171-3/+1
|
* compat: move version logic to compat.h and out of main .cJason A. Donenfeld2017-10-111-2/+2
|
* routingtable: iterate progressivelyJason A. Donenfeld2017-10-091-16/+21
|
* routingtable: only use device's mutex, not a special rt oneJason A. Donenfeld2017-10-091-4/+4
|
* compat: macro rewrite netlink instead of clutteringJason A. Donenfeld2017-10-051-19/+10
|
* global: add space around variable declarationsJason A. Donenfeld2017-10-031-0/+6
|
* netlink: switch from ioctl to netlink for configurationJason A. Donenfeld2017-10-021-0/+494