diff options
author | Julius Bünger <buenger@mytum.de> | 2015-03-25 20:52:43 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2015-03-25 20:52:43 +0000 |
commit | b25eb3c3774f491c303fe4f68dd7c225246afdfe (patch) | |
tree | fb315afe82807ec0d0b039d293dd76aa0c51846d /src | |
parent | 19c380f237708910a12f14e98960919e9fe6d865 (diff) | |
download | gnunet-b25eb3c3774f491c303fe4f68dd7c225246afdfe.tar.gz gnunet-b25eb3c3774f491c303fe4f68dd7c225246afdfe.zip |
-malicious peer type 1 sending pushes
Diffstat (limited to 'src')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 0270b3840..67e79daf7 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -397,8 +397,14 @@ struct AttackedPeer | |||
397 | /** | 397 | /** |
398 | * If type is 2 this is the DLL of attacked peers | 398 | * If type is 2 this is the DLL of attacked peers |
399 | */ | 399 | */ |
400 | //static struct AttackedPeer *att_peers_head = NULL; | 400 | static struct AttackedPeer *att_peers_head = NULL; |
401 | //static struct AttackedPeer *att_peers_tail = NULL; | 401 | static struct AttackedPeer *att_peers_tail = NULL; |
402 | |||
403 | /** | ||
404 | * This index is used to point to an attacked peer to | ||
405 | * implement the round-robin-ish way to select attacked peers. | ||
406 | */ | ||
407 | static struct AttackedPeer *att_peer_index = NULL; | ||
402 | 408 | ||
403 | /** | 409 | /** |
404 | * Number of attacked peers | 410 | * Number of attacked peers |
@@ -1622,8 +1628,12 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1622 | num_pushes = min (min (push_limit, /* FIXME: attacked peer */ num_mal_peers), GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE); | 1628 | num_pushes = min (min (push_limit, /* FIXME: attacked peer */ num_mal_peers), GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE); |
1623 | for (i = 0 ; i < num_pushes ; i++) | 1629 | for (i = 0 ; i < num_pushes ; i++) |
1624 | { /* Send PUSHes to attacked peers */ | 1630 | { /* Send PUSHes to attacked peers */ |
1625 | //GNUNET_CONTAINER_multihashmap_iterator_create | 1631 | if (att_peers_tail == att_peer_index) |
1626 | //send_push (); | 1632 | att_peer_index = att_peers_head; |
1633 | else | ||
1634 | att_peer_index = att_peer_index->next; | ||
1635 | |||
1636 | send_push (att_peer_index->peer_id); | ||
1627 | 1637 | ||
1628 | // TODO send pulls | 1638 | // TODO send pulls |
1629 | // send_pull_request | 1639 | // send_pull_request |