From: Julius Bünger Date: Wed, 25 Mar 2015 20:52:43 +0000 (+0000) Subject: -malicious peer type 1 sending pushes X-Git-Tag: initial-import-from-subversion-38251~2135 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b25eb3c3774f491c303fe4f68dd7c225246afdfe;p=oweals%2Fgnunet.git -malicious peer type 1 sending pushes --- 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 /** * If type is 2 this is the DLL of attacked peers */ -//static struct AttackedPeer *att_peers_head = NULL; -//static struct AttackedPeer *att_peers_tail = NULL; +static struct AttackedPeer *att_peers_head = NULL; +static struct AttackedPeer *att_peers_tail = NULL; + +/** + * This index is used to point to an attacked peer to + * implement the round-robin-ish way to select attacked peers. + */ +static struct AttackedPeer *att_peer_index = NULL; /** * Number of attacked peers @@ -1622,8 +1628,12 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) num_pushes = min (min (push_limit, /* FIXME: attacked peer */ num_mal_peers), GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE); for (i = 0 ; i < num_pushes ; i++) { /* Send PUSHes to attacked peers */ - //GNUNET_CONTAINER_multihashmap_iterator_create - //send_push (); + if (att_peers_tail == att_peer_index) + att_peer_index = att_peers_head; + else + att_peer_index = att_peer_index->next; + + send_push (att_peer_index->peer_id); // TODO send pulls // send_pull_request