never pass addresses for ourselves to ATS
authorChristian Grothoff <christian@grothoff.org>
Mon, 26 Oct 2015 15:59:32 +0000 (15:59 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 26 Oct 2015 15:59:32 +0000 (15:59 +0000)
src/transport/gnunet-service-transport_ats.c
src/transport/transport_api.c

index d6bc836d377eaf63b91b8da45e62356933c437bd..faf97c8fe089a8f8b71ea990050735e4f409091c 100644 (file)
@@ -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),
index e84ef9898aaf54ca7cddfd8bf1ab7e7c705886c2..55caf407a5d88a453a1f993d69f8d8b8b5379d70 100644 (file)
@@ -990,7 +990,8 @@ transport_notify_ready (void *cls,
     if (th->notify_size + sizeof (struct OutboundMessage) > size)
       break;                    /* does not fit */
     if (GNUNET_BANDWIDTH_tracker_get_delay
-        (&n->out_tracker, th->notify_size).rel_value_us > 0)
+        (&n->out_tracker,
+         th->notify_size).rel_value_us > 0)
       break;                    /* too early */
     GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap));
     n->hn = NULL;