From: Christian Grothoff Date: Wed, 18 Dec 2013 23:16:05 +0000 (+0000) Subject: -consider possibility that DV message arrives after direct connection was established X-Git-Tag: initial-import-from-subversion-38251~5309 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d3c4c634d7f09a05865a7d1a3050c8493f02c712;p=oweals%2Fgnunet.git -consider possibility that DV message arrives after direct connection was established --- diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 9132d2a34..7d5f24e6e 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c @@ -1812,12 +1812,21 @@ handle_dv_route_message (void *cls, const struct GNUNET_PeerIdentity *peer, &my_identity, sizeof (struct GNUNET_PeerIdentity))) { + if (NULL != GNUNET_CONTAINER_multipeermap_get (direct_neighbors, + &rm->sender)) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Discarding DV message, as %s is a direct neighbor\n", + GNUNET_i2s (&rm->sender)); + GNUNET_STATISTICS_update (stats, + "# messages discarded (direct neighbor)", + 1, GNUNET_NO); + return GNUNET_OK; + } /* message is for me, check reverse route! */ route = GNUNET_CONTAINER_multipeermap_get (all_routes, &rm->sender); if ( (NULL == route) && - (NULL == GNUNET_CONTAINER_multipeermap_get (direct_neighbors, - &rm->sender)) && (distance < DEFAULT_FISHEYE_DEPTH) ) { /* don't have reverse route yet, learn it! */