aboutsummaryrefslogtreecommitdiff
path: root/src/secretsharing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-10 17:11:06 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-10 17:11:06 +0000
commitb8fc68d6cb81adb3803186359b3a30b1a4bb7b5a (patch)
treebe6defbdf18e3af9bdcc979cf27b253fe0b4d5f9 /src/secretsharing
parent3871fc32bbd05da817d94f4188023a4edebc367a (diff)
downloadgnunet-b8fc68d6cb81adb3803186359b3a30b1a4bb7b5a.tar.gz
gnunet-b8fc68d6cb81adb3803186359b3a30b1a4bb7b5a.zip
moving away from DEFAULTSERVICES to per-section FORCESTART, thus addressing #3565 indirectly
Diffstat (limited to 'src/secretsharing')
-rw-r--r--src/secretsharing/gnunet-service-secretsharing.c18
-rw-r--r--src/secretsharing/test_secretsharing.conf6
2 files changed, 15 insertions, 9 deletions
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c
index 0a22561cd..a0e440084 100644
--- a/src/secretsharing/gnunet-service-secretsharing.c
+++ b/src/secretsharing/gnunet-service-secretsharing.c
@@ -409,7 +409,9 @@ time_between (struct GNUNET_TIME_Absolute start,
409static int 409static int
410peer_id_cmp (const void *p1, const void *p2) 410peer_id_cmp (const void *p1, const void *p2)
411{ 411{
412 return memcmp (p1, p2, sizeof (struct GNUNET_PeerIdentity)); 412 return memcmp (p1,
413 p2,
414 sizeof (struct GNUNET_PeerIdentity));
413} 415}
414 416
415 417
@@ -427,8 +429,11 @@ peer_find (const struct GNUNET_PeerIdentity *haystack, unsigned int n,
427 const struct GNUNET_PeerIdentity *needle) 429 const struct GNUNET_PeerIdentity *needle)
428{ 430{
429 unsigned int i; 431 unsigned int i;
432
430 for (i = 0; i < n; i++) 433 for (i = 0; i < n; i++)
431 if (0 == memcmp (&haystack[i], needle, sizeof (struct GNUNET_PeerIdentity))) 434 if (0 == memcmp (&haystack[i],
435 needle,
436 sizeof (struct GNUNET_PeerIdentity)))
432 return i; 437 return i;
433 return -1; 438 return -1;
434} 439}
@@ -468,8 +473,13 @@ normalize_peers (struct GNUNET_PeerIdentity *listed,
468 if (GNUNET_NO == local_peer_in_list) 473 if (GNUNET_NO == local_peer_in_list)
469 normalized[n - 1] = my_peer; 474 normalized[n - 1] = my_peer;
470 475
471 memcpy (normalized, listed, num_listed * sizeof (struct GNUNET_PeerIdentity)); 476 memcpy (normalized,
472 qsort (normalized, n, sizeof (struct GNUNET_PeerIdentity), &peer_id_cmp); 477 listed,
478 num_listed * sizeof (struct GNUNET_PeerIdentity));
479 qsort (normalized,
480 n,
481 sizeof (struct GNUNET_PeerIdentity),
482 &peer_id_cmp);
473 483
474 if (NULL != my_peer_idx) 484 if (NULL != my_peer_idx)
475 *my_peer_idx = peer_find (normalized, n, &my_peer); 485 *my_peer_idx = peer_find (normalized, n, &my_peer);
diff --git a/src/secretsharing/test_secretsharing.conf b/src/secretsharing/test_secretsharing.conf
index ec31ae8f0..9980666cd 100644
--- a/src/secretsharing/test_secretsharing.conf
+++ b/src/secretsharing/test_secretsharing.conf
@@ -10,10 +10,6 @@ AUTOSTART = YES
10OPTIONS = -LERROR 10OPTIONS = -LERROR
11PLUGINS = unix 11PLUGINS = unix
12 12
13
14[arm]
15DEFAULTSERVICES = core consensus set secretsharing
16
17[set] 13[set]
18OPTIONS = -L INFO 14OPTIONS = -L INFO
19AUTOSTART = YES 15AUTOSTART = YES
@@ -23,7 +19,7 @@ AUTOSTART = YES
23OVERLAY_TOPOLOGY = CLIQUE 19OVERLAY_TOPOLOGY = CLIQUE
24 20
25[hostlist] 21[hostlist]
26SERVERS = 22SERVERS =
27 23
28[nat] 24[nat]
29# Use addresses from the local network interfaces (inluding loopback, but also others) 25# Use addresses from the local network interfaces (inluding loopback, but also others)