aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rps/gnunet-service-rps.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 34d4b5095..3e7111493 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -486,11 +486,6 @@ static uint32_t push_limit = 10000;
486#define unset_peer_flag(peer_ctx, mask) (peer_ctx->peer_flags &= (~mask)) 486#define unset_peer_flag(peer_ctx, mask) (peer_ctx->peer_flags &= (~mask))
487 487
488/** 488/**
489 * Compute the minimum of two ints
490 */
491#define min(x, y) ((x < y) ? x : y)
492
493/**
494 * Clean the send channel of a peer 489 * Clean the send channel of a peer
495 */ 490 */
496void 491void
@@ -1865,9 +1860,9 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1865 { /* Try to maximise representation */ 1860 { /* Try to maximise representation */
1866 1861
1867 /* The maximum of pushes we're going to send this round */ 1862 /* The maximum of pushes we're going to send this round */
1868 num_pushes = min (min (push_limit, 1863 num_pushes = GNUNET_MIN (GNUNET_MIN (push_limit,
1869 num_attacked_peers), 1864 num_attacked_peers),
1870 GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE); 1865 GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE);
1871 1866
1872 /* Send PUSHes to attacked peers */ 1867 /* Send PUSHes to attacked peers */
1873 for (i = 0 ; i < num_pushes ; i++) 1868 for (i = 0 ; i < num_pushes ; i++)
@@ -1907,9 +1902,9 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1907 { /* Combined attack */ 1902 { /* Combined attack */
1908 1903
1909 /* The maximum of pushes we're going to send this round */ 1904 /* The maximum of pushes we're going to send this round */
1910 num_pushes = min (min (push_limit, 1905 num_pushes = GNUNET_MIN (GNUNET_MIN (push_limit - 1,
1911 num_attacked_peers), 1906 num_attacked_peers),
1912 GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE) - 1; 1907 GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE);
1913 1908
1914 /* Send PUSHes to attacked peers */ 1909 /* Send PUSHes to attacked peers */
1915 send_push (&attacked_peer); 1910 send_push (&attacked_peer);