diff options
author | Julius Bünger <buenger@mytum.de> | 2015-06-26 16:57:21 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2015-06-26 16:57:21 +0000 |
commit | 3730989b3197381bdaf381b59c1f1ad30b3a1efe (patch) | |
tree | 5b7c2de4d8633f9c223e8d6e38253a8b787e7e03 /src | |
parent | fa5861fb743f904aee9a59da9c760b79421700ed (diff) | |
download | gnunet-3730989b3197381bdaf381b59c1f1ad30b3a1efe.tar.gz gnunet-3730989b3197381bdaf381b59c1f1ad30b3a1efe.zip |
-fix coverity 0003864
Diffstat (limited to 'src')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 698473f45..08f880609 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -1976,6 +1976,7 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1976 | uint32_t i; | 1976 | uint32_t i; |
1977 | struct GNUNET_TIME_Relative time_next_round; | 1977 | struct GNUNET_TIME_Relative time_next_round; |
1978 | struct AttackedPeer *tmp_att_peer; | 1978 | struct AttackedPeer *tmp_att_peer; |
1979 | struct PeerContext *peer_ctx; | ||
1979 | 1980 | ||
1980 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to execute next round maliciously type %" PRIu32 ".\n", | 1981 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to execute next round maliciously type %" PRIu32 ".\n", |
1981 | mal_type); | 1982 | mal_type); |
@@ -2031,6 +2032,20 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2031 | if (3 == mal_type) | 2032 | if (3 == mal_type) |
2032 | { /* Combined attack */ | 2033 | { /* Combined attack */ |
2033 | 2034 | ||
2035 | /* Send PUSH to attacked peers */ | ||
2036 | peer_ctx = get_peer_ctx (peer_map, &attacked_peer); | ||
2037 | if (GNUNET_YES == get_peer_flag (peer_ctx, VALID) | ||
2038 | || NULL != peer_ctx->send_channel | ||
2039 | || NULL != peer_ctx->recv_channel) | ||
2040 | { | ||
2041 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2042 | "Goding to send push to attacked peer (%s)\n", | ||
2043 | GNUNET_i2s (&attacked_peer)); | ||
2044 | send_push (&attacked_peer); | ||
2045 | } | ||
2046 | else | ||
2047 | check_peer_live (peer_ctx); | ||
2048 | |||
2034 | /* The maximum of pushes we're going to send this round */ | 2049 | /* The maximum of pushes we're going to send this round */ |
2035 | num_pushes = GNUNET_MIN (GNUNET_MIN (push_limit - 1, | 2050 | num_pushes = GNUNET_MIN (GNUNET_MIN (push_limit - 1, |
2036 | num_attacked_peers), | 2051 | num_attacked_peers), |
@@ -2040,9 +2055,6 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2040 | "Going to send %" PRIu32 " pushes\n", | 2055 | "Going to send %" PRIu32 " pushes\n", |
2041 | num_pushes); | 2056 | num_pushes); |
2042 | 2057 | ||
2043 | /* Send PUSHes to attacked peers */ | ||
2044 | send_push (&attacked_peer); | ||
2045 | |||
2046 | for (i = 0 ; i < num_pushes ; i++) | 2058 | for (i = 0 ; i < num_pushes ; i++) |
2047 | { | 2059 | { |
2048 | if (att_peers_tail == att_peer_index) | 2060 | if (att_peers_tail == att_peer_index) |