summaryrefslogtreecommitdiffhomepage
path: root/src/timers.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-01-23 18:56:31 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-01-23 18:56:31 +0100
commit9d3e3ce80f90ede1d789fcd27d9dbd9c63a00761 (patch)
treedf5dabe05b1c6b705c67c474d2f130f7a0e1a725 /src/timers.c
parentf9e7708ba3e47f5b82e0e1f0dea89e3630b2c163 (diff)
timers: use setup_timer macro helper
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/timers.c')
-rw-r--r--src/timers.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/timers.c b/src/timers.c
index 91ef0b3..3e6456c 100644
--- a/src/timers.c
+++ b/src/timers.c
@@ -153,26 +153,11 @@ void timers_any_authenticated_packet_traversal(struct wireguard_peer *peer)
void timers_init_peer(struct wireguard_peer *peer)
{
- init_timer(&peer->timer_retransmit_handshake);
- peer->timer_retransmit_handshake.function = expired_retransmit_handshake;
- peer->timer_retransmit_handshake.data = (unsigned long)peer;
-
- init_timer(&peer->timer_send_keepalive);
- peer->timer_send_keepalive.function = expired_send_keepalive;
- peer->timer_send_keepalive.data = (unsigned long)peer;
-
- init_timer(&peer->timer_new_handshake);
- peer->timer_new_handshake.function = expired_new_handshake;
- peer->timer_new_handshake.data = (unsigned long)peer;
-
- init_timer(&peer->timer_kill_ephemerals);
- peer->timer_kill_ephemerals.function = expired_kill_ephemerals;
- peer->timer_kill_ephemerals.data = (unsigned long)peer;
-
- init_timer(&peer->timer_persistent_keepalive);
- peer->timer_persistent_keepalive.function = expired_send_persistent_keepalive;
- peer->timer_persistent_keepalive.data = (unsigned long)peer;
-
+ setup_timer(&peer->timer_retransmit_handshake, expired_retransmit_handshake, (unsigned long)peer);
+ setup_timer(&peer->timer_send_keepalive, expired_send_keepalive, (unsigned long)peer);
+ setup_timer(&peer->timer_new_handshake, expired_new_handshake, (unsigned long)peer);
+ setup_timer(&peer->timer_kill_ephemerals, expired_kill_ephemerals, (unsigned long)peer);
+ setup_timer(&peer->timer_persistent_keepalive, expired_send_persistent_keepalive, (unsigned long)peer);
INIT_WORK(&peer->clear_peer_work, queued_expired_kill_ephemerals);
}