From 837469c7478ff5fb87e10c57fedbfae123e3c9aa Mon Sep 17 00:00:00 2001 From: thorkill Date: Sun, 5 Jul 2015 00:16:02 +0200 Subject: [PATCH] Add small jitter to keyexpire_handle and edgeupdate_handler --- src/net_setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net_setup.c b/src/net_setup.c index 83d41cd7..8acff604 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -311,12 +311,12 @@ static timeout_t edgeupdate_timeout; static void keyexpire_handler(void *data) { regenerate_key(); - timeout_set(data, &(struct timeval){keylifetime, rand() % 100000}); + timeout_set(data, &(struct timeval){keylifetime + (rand() % 10), rand() % 100000}); } static void edgeupdate_handler(void *data) { update_edge_weight(); - timeout_set(data, &(struct timeval){edgeupdateinterval, rand() % 100000}); + timeout_set(data, &(struct timeval){edgeupdateinterval + (rand() % 10), rand() % 100000}); } void regenerate_key(void) {