gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r12010 - gnunet/src/dv


From: gnunet
Subject: [GNUnet-SVN] r12010 - gnunet/src/dv
Date: Mon, 28 Jun 2010 13:15:55 +0200

Author: nevans
Date: 2010-06-28 13:15:55 +0200 (Mon, 28 Jun 2010)
New Revision: 12010

Modified:
   gnunet/src/dv/gnunet-service-dv.c
   gnunet/src/dv/plugin_transport_dv.c
Log:
check address change, remove unused debugging case

Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c   2010-06-28 11:07:52 UTC (rev 12009)
+++ gnunet/src/dv/gnunet-service-dv.c   2010-06-28 11:15:55 UTC (rev 12010)
@@ -3015,12 +3015,6 @@
                                 GNUNET_TIME_UNIT_FOREVER_REL,
                                 &shutdown_task,
                                 NULL);
-#if INSANE_GOSSIP
-  GNUNET_SCHEDULER_add_delayed (sched,
-                                
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5),
-                                &gossip_all_to_all,
-                                NULL);
-#endif
 }
 
 

Modified: gnunet/src/dv/plugin_transport_dv.c
===================================================================
--- gnunet/src/dv/plugin_transport_dv.c 2010-06-28 11:07:52 UTC (rev 12009)
+++ gnunet/src/dv/plugin_transport_dv.c 2010-06-28 11:15:55 UTC (rev 12010)
@@ -342,21 +342,24 @@
 }
 
 /**
- * Another peer has suggested an address for this
- * peer and transport plugin.  Check that this could be a valid
- * address.  If so, consider adding it to the list
- * of addresses.
+ * Another peer has suggested an address for this peer and transport
+ * plugin.  Check that this could be a valid address.  This function
+ * is not expected to 'validate' the address in the sense of trying to
+ * connect to it but simply to see if the binary format is technically
+ * legal for establishing a connection to this peer (and make sure that
+ * the address really corresponds to our network connection/settings
+ * and not some potential man-in-the-middle).
  *
  * @param cls closure
  * @param addr pointer to the address
  * @param addrlen length of addr
  * @return GNUNET_OK if this is a plausible address for this peer
- *         and transport
+ *         and transport, GNUNET_SYSERR if not
  *
  */
 static int
-dv_plugin_address_suggested (void *cls,
-                             void *addr, size_t addrlen)
+dv_plugin_check_address (void *cls,
+                         const void *addr, size_t addrlen)
 {
   struct Plugin *plugin = cls;
   /* Verify that the first peer of this address matches our peer id! */
@@ -365,12 +368,11 @@
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: Address not correct size or 
identity doesn't match ours!\n", GNUNET_i2s(plugin->env->my_identity));
     if (addrlen == (2 * sizeof(struct GNUNET_PeerIdentity)))
     {
-      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer in addr is %s\n", 
GNUNET_i2s(addr));
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer in address is %s\n", 
GNUNET_i2s(addr));
     }
-    return GNUNET_NO;
+    return GNUNET_SYSERR;
   }
-  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s: Address verified!\n", 
GNUNET_i2s(plugin->env->my_identity));
-  return GNUNET_YES;
+  return GNUNET_OK;
 }
 
 
@@ -400,7 +402,7 @@
   api->send = &dv_plugin_send;
   api->disconnect = &dv_plugin_disconnect;
   api->address_pretty_printer = &dv_plugin_address_pretty_printer;
-  api->check_address = &dv_plugin_address_suggested;
+  api->check_address = &dv_plugin_check_address;
   api->address_to_string = &address_to_string;
   return api;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]