gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11506 - gnunet/src/hello


From: gnunet
Subject: [GNUnet-SVN] r11506 - gnunet/src/hello
Date: Tue, 25 May 2010 17:53:50 +0200

Author: grothoff
Date: 2010-05-25 17:53:50 +0200 (Tue, 25 May 2010)
New Revision: 11506

Modified:
   gnunet/src/hello/hello.c
Log:
check that peers match, fix docu

Modified: gnunet/src/hello/hello.c
===================================================================
--- gnunet/src/hello/hello.c    2010-05-25 15:53:30 UTC (rev 11505)
+++ gnunet/src/hello/hello.c    2010-05-25 15:53:50 UTC (rev 11506)
@@ -570,11 +570,9 @@
                     addrlen)) )
     {
       ec->found = GNUNET_YES;
-      if (expiration.value < ec->expiration.value)
-       {
-         ec->result = GNUNET_TIME_absolute_min (expiration,
-                                                ec->result);
-       }
+      if (expiration.value < ec->expiration.value)     
+       ec->result = GNUNET_TIME_absolute_min (expiration,
+                                              ec->result);             
       return GNUNET_SYSERR;
     }
   return GNUNET_YES;
@@ -618,10 +616,10 @@
  * @param h2 the second HELLO message
  * @param now time to use for deciding which addresses have
  *            expired and should not be considered at all
- * @return absolute time zero if the two HELLOs are 
+ * @return absolute time forever if the two HELLOs are 
  *         totally identical; smallest timestamp >= now if
  *         they only differ in timestamps; 
- *         forever if the some addresses with expirations >= now
+ *         zero if the some addresses with expirations >= now
  *         do not match at all
  */
 struct GNUNET_TIME_Absolute 
@@ -633,6 +631,10 @@
 {
   struct EqualsContext ec;
 
+  if (0 != memcmp (&h1->publicKey,
+                  &h2->publicKey,
+                  sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
+    return GNUNET_TIME_UNIT_ZERO_ABS;
   ec.expiration_limit = now;
   ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;
   ec.h2 = h2;




reply via email to

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