gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r4964 - in GNUnet/src: applications/transport transports


From: gnunet
Subject: [GNUnet-SVN] r4964 - in GNUnet/src: applications/transport transports
Date: Fri, 8 Jun 2007 15:47:41 -0600 (MDT)

Author: grothoff
Date: 2007-06-08 15:47:41 -0600 (Fri, 08 Jun 2007)
New Revision: 4964

Modified:
   GNUnet/src/applications/transport/transport.c
   GNUnet/src/transports/nat.c
Log:
more sanity

Modified: GNUnet/src/applications/transport/transport.c
===================================================================
--- GNUnet/src/applications/transport/transport.c       2007-06-08 21:24:47 UTC 
(rev 4963)
+++ GNUnet/src/applications/transport/transport.c       2007-06-08 21:47:41 UTC 
(rev 4964)
@@ -331,9 +331,8 @@
   unsigned short prot;
 
   prot = ntohs(hello->protocol);
-  if ( (prot == NAT_PROTOCOL_NUMBER) &&
-       ( (ntohs(hello->header.size) != P2P_hello_MESSAGE_size(hello)) ||
-        (ntohs(hello->header.type) != p2p_PROTO_hello) ) )
+  if ( (ntohs(hello->header.size) != P2P_hello_MESSAGE_size(hello)) ||
+       (ntohs(hello->header.type) != p2p_PROTO_hello) )
     return SYSERR; /* invalid */
   if ( (ntohs(hello->protocol) >= tapis_count) ||
        (tapis[prot] == NULL) )

Modified: GNUnet/src/transports/nat.c
===================================================================
--- GNUnet/src/transports/nat.c 2007-06-08 21:24:47 UTC (rev 4963)
+++ GNUnet/src/transports/nat.c 2007-06-08 21:47:41 UTC (rev 4964)
@@ -62,22 +62,21 @@
        (ntohs(hello->header.size) != P2P_hello_MESSAGE_size(hello)) ||
        (ntohs(hello->header.type) != p2p_PROTO_hello) ) {
     return SYSERR; /* obviously invalid */
-  } else {
-    if (YES == GC_get_configuration_value_yesno(coreAPI->cfg,
-                                               "NAT",
-                                               "LIMITED",
-                                               NO)) {
-      /* if WE are a NAT and this is not our hello,
-        it is invalid since NAT-to-NAT is not possible! */
-      if (0 == memcmp(&coreAPI->myIdentity->hashPubKey,
-                     &hello->senderIdentity.hashPubKey,
-                     sizeof(HashCode512)))
-       return OK;
-      else
-       return SYSERR;
-    }
-    return OK;
   }
+  if (YES == GC_get_configuration_value_yesno(coreAPI->cfg,
+                                             "NAT",
+                                             "LIMITED",
+                                             NO)) {
+    /* if WE are a NAT and this is not our hello,
+       it is invalid since NAT-to-NAT is not possible! */
+    if (0 == memcmp(&coreAPI->myIdentity->hashPubKey,
+                   &hello->senderIdentity.hashPubKey,
+                   sizeof(HashCode512)))
+      return OK;
+    else
+      return SYSERR;
+  }
+  return OK;  
 }
 
 /**





reply via email to

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