aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-07-25 12:35:33 +0000
committerNathan S. Evans <evans@in.tum.de>2011-07-25 12:35:33 +0000
commit00b0f3c22aab316068326a26f89219eddc7f6ef9 (patch)
tree278284fa33fa8fcb3658bbdc016fb74dc2c50fc4
parente71d9566d93393706db1d14945d3e559e3355454 (diff)
downloadgnunet-00b0f3c22aab316068326a26f89219eddc7f6ef9.tar.gz
gnunet-00b0f3c22aab316068326a26f89219eddc7f6ef9.zip
clock skew, testing half
-rw-r--r--src/testing/testing_group.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 4231e450a..f2442aade 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -1372,6 +1372,8 @@ make_config(const struct GNUNET_CONFIGURATION_Handle *cfg, uint32_t off,
1372 uint16_t orig; 1372 uint16_t orig;
1373 char *control_host; 1373 char *control_host;
1374 char *allowed_hosts; 1374 char *allowed_hosts;
1375 unsigned long long skew_variance;
1376 unsigned long long skew_offset;
1375 1377
1376 orig = *port; 1378 orig = *port;
1377 uc.nport = *port; 1379 uc.nport = *port;
@@ -1389,6 +1391,16 @@ make_config(const struct GNUNET_CONFIGURATION_Handle *cfg, uint32_t off,
1389 return NULL; 1391 return NULL;
1390 } 1392 }
1391 1393
1394 if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_number (cfg, "testing",
1395 "skew_variance",
1396 &skew_variance))
1397 && (skew_variance > 0))
1398 {
1399 skew_variance *= 2;
1400 skew_offset = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, skew_variance + 1);
1401 GNUNET_CONFIGURATION_set_value_number(uc.ret, "testing", "skew_offset", skew_offset);
1402 }
1403
1392 if (GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "control_host", 1404 if (GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "control_host",
1393 &control_host) == GNUNET_OK) 1405 &control_host) == GNUNET_OK)
1394 { 1406 {