aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-07-25 14:34:51 +0000
committerNathan S. Evans <evans@in.tum.de>2011-07-25 14:34:51 +0000
commitd2469f4bd8f26105392c7ccd110f38f6e2e8a8de (patch)
treeb442cb3e728f74b792408e42bd3b311c61f2c32e /src
parentccab5a16e199973be3ec62612ee43a0fa62e7497 (diff)
downloadgnunet-d2469f4bd8f26105392c7ccd110f38f6e2e8a8de.tar.gz
gnunet-d2469f4bd8f26105392c7ccd110f38f6e2e8a8de.zip
normal distribution
Diffstat (limited to 'src')
-rw-r--r--src/testing/testing_group.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index b9ccf69f2..21a486054 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -1385,6 +1385,7 @@ make_config(const struct GNUNET_CONFIGURATION_Handle *cfg, uint32_t off,
1385 char *allowed_hosts; 1385 char *allowed_hosts;
1386 unsigned long long skew_variance; 1386 unsigned long long skew_variance;
1387 unsigned long long skew_offset; 1387 unsigned long long skew_offset;
1388 long long actual_offset;
1388 1389
1389 orig = *port; 1390 orig = *port;
1390 uc.nport = *port; 1391 uc.nport = *port;
@@ -1407,8 +1408,10 @@ make_config(const struct GNUNET_CONFIGURATION_Handle *cfg, uint32_t off,
1407 &skew_variance)) 1408 &skew_variance))
1408 && (skew_variance > 0)) 1409 && (skew_variance > 0))
1409 { 1410 {
1410 skew_variance *= 2;
1411 skew_offset = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, skew_variance + 1); 1411 skew_offset = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, skew_variance + 1);
1412 actual_offset = skew_offset - GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, skew_variance + 1);
1413 /* Min is -skew_variance, Max is skew_variance */
1414 skew_offset = skew_variance + actual_offset; /* Normal distribution around 0 */
1412 GNUNET_CONFIGURATION_set_value_number(uc.ret, "testing", "skew_offset", skew_offset); 1415 GNUNET_CONFIGURATION_set_value_number(uc.ret, "testing", "skew_offset", skew_offset);
1413 } 1416 }
1414 1417