From b25eb3c3774f491c303fe4f68dd7c225246afdfe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Wed, 25 Mar 2015 20:52:43 +0000 Subject: [PATCH] -malicious peer type 1 sending pushes --- src/rps/gnunet-service-rps.c | 18 ++++++++++++++---- 1 file 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 /** * 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 -- 2.25.1