summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-09-28 15:32:03 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-02 02:45:53 +0200
commit9c5af58105b7c0d2cc51f95d568264322f23e1e2 (patch)
tree4c392c432dd74b846d4a0e53c98332b0b456f4d5
parentadc504c865ebe70cf112c5ecc150e081312180c3 (diff)
peer: ensure that lookup tables are added last
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/peer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/peer.c b/src/peer.c
index 0bc1612..d5fbdb8 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -39,17 +39,17 @@ struct wireguard_peer *peer_create(struct wireguard_device *wg, const u8 public_
kfree(peer);
return NULL;
}
+ timers_init(peer);
cookie_checker_precompute_peer_keys(peer);
mutex_init(&peer->keypairs.keypair_update_lock);
INIT_WORK(&peer->transmit_handshake_work, packet_handshake_send_worker);
rwlock_init(&peer->endpoint_lock);
kref_init(&peer->refcount);
- pubkey_hashtable_add(&wg->peer_hashtable, peer);
- list_add_tail(&peer->peer_list, &wg->peer_list);
packet_queue_init(&peer->tx_queue, packet_tx_worker, false);
packet_queue_init(&peer->rx_queue, packet_rx_worker, false);
skb_queue_head_init(&peer->staged_packet_queue);
- timers_init(peer);
+ list_add_tail(&peer->peer_list, &wg->peer_list);
+ pubkey_hashtable_add(&wg->peer_hashtable, peer);
pr_debug("%s: Peer %Lu created\n", wg->dev->name, peer->internal_id);
return peer;
}