disable LAN/loopback for AC
[oweals/gnunet.git] / src / transport / gnunet-service-transport_validation.c
index 5a8539f72ea25c253264f84c28164ddac48f4c06..cd5aeb5e27c31d324211456a52cf2bb06f584cfc 100644 (file)
@@ -697,6 +697,7 @@ revalidate_address (void *cls)
   struct GNUNET_TIME_Relative canonical_delay;
   struct GNUNET_TIME_Relative delay;
   struct GNUNET_TIME_Relative blocked_for;
+  struct GST_BlacklistCheck *bc;
   uint32_t rdelay;
 
   ve->revalidation_task = NULL;
@@ -788,12 +789,19 @@ revalidate_address (void *cls)
     GST_blacklist_test_cancel (ve->bc);
     ve->bc = NULL;
   }
-  ve->bc = GST_blacklist_test_allowed (&ve->address->peer,
-                                       ve->address->transport_name,
-                                       &transmit_ping_if_allowed,
-                                       ve,
-                                       NULL,
-                                       NULL);
+  bc = GST_blacklist_test_allowed (&ve->address->peer,
+                                   ve->address->transport_name,
+                                   &transmit_ping_if_allowed,
+                                   ve,
+                                   NULL,
+                                   NULL);
+  if (NULL != bc)
+  {
+    /* If transmit_ping_if_allowed was already called it may have freed ve,
+     * so only set ve->bc if it has not been called.
+     */
+    ve->bc = bc;
+  }
 }
 
 
@@ -1339,6 +1347,9 @@ GST_validation_handle_address (const struct GNUNET_HELLO_Address *address)
   if (NULL == papi)
   {
     /* This plugin is currently unvailable ... ignore */
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "No plugin available for %s\n",
+                address->transport_name);
     return;
   }
   ve = find_validation_entry (address);
@@ -1350,6 +1361,13 @@ GST_validation_handle_address (const struct GNUNET_HELLO_Address *address)
                 GNUNET_i2s (&ve->address->peer));
     ve->revalidation_task = GNUNET_SCHEDULER_add_now (&revalidate_address, ve);
   }
+  else
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "Validation already running for address `%s' of %s\n",
+                GST_plugins_a2s (ve->address),
+                GNUNET_i2s (&ve->address->peer));
+  }
 }
 
 
@@ -1649,6 +1667,9 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello)
              sizeof (struct GNUNET_PeerIdentity)))
   {
     /* got our own HELLO, how boring */
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+               "Validation received our own HELLO (%s), ignoring\n",
+               GNUNET_i2s (&pid));
     return GNUNET_OK;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,