summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_ats.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-26 15:59:32 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-26 15:59:32 +0000
commitb11629b8f1822e8fadc1f6a25138c4586e61a38a (patch)
tree4386313eccbd4b60b476f46f20798d844ff89843 /src/transport/gnunet-service-transport_ats.c
parentdb0277d48a208cb6630e4507404a7b0e10f8eca2 (diff)
never pass addresses for ourselves to ATS
Diffstat (limited to 'src/transport/gnunet-service-transport_ats.c')
-rw-r--r--src/transport/gnunet-service-transport_ats.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c
index d6bc836d3..faf97c8fe 100644
--- a/src/transport/gnunet-service-transport_ats.c
+++ b/src/transport/gnunet-service-transport_ats.c
@@ -332,6 +332,11 @@ GST_ats_block_address (const struct GNUNET_HELLO_Address *address,
{
struct AddressInfo *ai;
+ if (0 ==
+ memcmp (&GST_my_identity,
+ &address->peer,
+ sizeof (struct GNUNET_PeerIdentity)))
+ return; /* our own, ignore! */
ai = find_ai (address,
session);
if (NULL == ai)
@@ -399,6 +404,11 @@ GST_ats_block_reset (const struct GNUNET_HELLO_Address *address,
{
struct AddressInfo *ai;
+ if (0 ==
+ memcmp (&GST_my_identity,
+ &address->peer,
+ sizeof (struct GNUNET_PeerIdentity)))
+ return; /* our own, ignore! */
ai = find_ai (address, session);
if (NULL == ai)
{
@@ -429,6 +439,12 @@ GST_ats_add_inbound_address (const struct GNUNET_HELLO_Address *address,
struct GNUNET_ATS_AddressRecord *ar;
struct AddressInfo *ai;
+ if (0 ==
+ memcmp (&GST_my_identity,
+ &address->peer,
+ sizeof (struct GNUNET_PeerIdentity)))
+ return; /* our own, ignore! */
+
/* Sanity checks for a valid inbound address */
if (NULL == address->transport_name)
{
@@ -487,6 +503,11 @@ GST_ats_add_address (const struct GNUNET_HELLO_Address *address,
struct GNUNET_ATS_AddressRecord *ar;
struct AddressInfo *ai;
+ if (0 ==
+ memcmp (&GST_my_identity,
+ &address->peer,
+ sizeof (struct GNUNET_PeerIdentity)))
+ return; /* our own, ignore! */
/* validadte address */
if (NULL == address->transport_name)
{
@@ -537,6 +558,11 @@ GST_ats_new_session (const struct GNUNET_HELLO_Address *address,
{
struct AddressInfo *ai;
+ if (0 ==
+ memcmp (&GST_my_identity,
+ &address->peer,
+ sizeof (struct GNUNET_PeerIdentity)))
+ return; /* our own, ignore! */
ai = find_ai (address, NULL);
if (NULL == ai)
{
@@ -615,6 +641,11 @@ GST_ats_del_session (const struct GNUNET_HELLO_Address *address,
{
struct AddressInfo *ai;
+ if (0 ==
+ memcmp (&GST_my_identity,
+ &address->peer,
+ sizeof (struct GNUNET_PeerIdentity)))
+ return; /* our own, ignore! */
if (NULL == session)
{
GNUNET_break (0);
@@ -828,6 +859,11 @@ GST_ats_expire_address (const struct GNUNET_HELLO_Address *address)
{
struct AddressInfo *ai;
+ if (0 ==
+ memcmp (&GST_my_identity,
+ &address->peer,
+ sizeof (struct GNUNET_PeerIdentity)))
+ return; /* our own, ignore! */
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Address %s of peer %s expired\n",
GST_plugins_a2s (address),