aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/netlink.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-25 17:56:08 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-31 17:25:23 +0100
commite09ec4dc2af38fb44add2fac518a726ae605b400 (patch)
tree950512f15664d121e92677ec1c35a5b1b1b870dc /src/netlink.c
parentqemu: work around ccache bugs (diff)
downloadwireguard-monolithic-historical-e09ec4dc2af38fb44add2fac518a726ae605b400.tar.xz
wireguard-monolithic-historical-e09ec4dc2af38fb44add2fac518a726ae605b400.zip
global: style nits
Diffstat (limited to 'src/netlink.c')
-rw-r--r--src/netlink.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 60c58e0..fa8a766 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -199,7 +199,8 @@ static int get_device_dump(struct sk_buff *skb, struct netlink_callback *cb)
ret = 0;
/* If the last cursor was removed via list_del_init in peer_remove, then we just treat
* this the same as there being no more peers left. The reason is that seq_nr should
- * indicate to userspace that this isn't a coherent dump anyway, so they'll try again. */
+ * indicate to userspace that this isn't a coherent dump anyway, so they'll try again.
+ */
if (list_empty(&wg->peer_list) || (last_peer_cursor && list_empty(&last_peer_cursor->peer_list))) {
nla_nest_cancel(skb, peers_nest);
goto out;
@@ -236,7 +237,8 @@ out:
/* At this point, we can't really deal ourselves with safely zeroing out
* the private key material after usage. This will need an additional API
- * in the kernel for marking skbs as zero_on_free. */
+ * in the kernel for marking skbs as zero_on_free.
+ */
}
static int get_device_done(struct netlink_callback *cb)
@@ -312,7 +314,8 @@ static int set_peer(struct wireguard_device *wg, struct nlattr **attrs)
down_read(&wg->static_identity.lock);
if (wg->static_identity.has_identity && !memcmp(nla_data(attrs[WGPEER_A_PUBLIC_KEY]), wg->static_identity.static_public, NOISE_PUBLIC_KEY_LEN)) {
/* We silently ignore peers that have the same public key as the device. The reason we do it silently
- * is that we'd like for people to be able to reuse the same set of API calls across peers. */
+ * is that we'd like for people to be able to reuse the same set of API calls across peers.
+ */
up_read(&wg->static_identity.lock);
ret = 0;
goto out;
@@ -420,7 +423,7 @@ static int set_device(struct sk_buff *skb, struct genl_info *info)
struct wireguard_peer *peer, *temp;
u8 public_key[NOISE_PUBLIC_KEY_LEN] = { 0 }, *private_key = nla_data(info->attrs[WGDEVICE_A_PRIVATE_KEY]);
/* We remove before setting, to prevent race, which means doing two 25519-genpub ops. */
- bool unused __attribute((unused)) = curve25519_generate_public(public_key, private_key);
+ __attribute((unused)) bool unused = curve25519_generate_public(public_key, private_key);
peer = pubkey_hashtable_lookup(&wg->peer_hashtable, public_key);
if (peer) {