diff options
Diffstat (limited to 'src/secretsharing')
-rw-r--r-- | src/secretsharing/gnunet-service-secretsharing.c | 18 | ||||
-rw-r--r-- | src/secretsharing/test_secretsharing.conf | 6 |
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, | |||
409 | static int | 409 | static int |
410 | peer_id_cmp (const void *p1, const void *p2) | 410 | peer_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 | |||
10 | OPTIONS = -LERROR | 10 | OPTIONS = -LERROR |
11 | PLUGINS = unix | 11 | PLUGINS = unix |
12 | 12 | ||
13 | |||
14 | [arm] | ||
15 | DEFAULTSERVICES = core consensus set secretsharing | ||
16 | |||
17 | [set] | 13 | [set] |
18 | OPTIONS = -L INFO | 14 | OPTIONS = -L INFO |
19 | AUTOSTART = YES | 15 | AUTOSTART = YES |
@@ -23,7 +19,7 @@ AUTOSTART = YES | |||
23 | OVERLAY_TOPOLOGY = CLIQUE | 19 | OVERLAY_TOPOLOGY = CLIQUE |
24 | 20 | ||
25 | [hostlist] | 21 | [hostlist] |
26 | SERVERS = | 22 | SERVERS = |
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) |