From e09ec4dc2af38fb44add2fac518a726ae605b400 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 25 Oct 2017 17:56:08 +0200 Subject: global: style nits --- src/netlink.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/netlink.c') 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) { -- cgit v1.2.3-59-g8ed1b