gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11753 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r11753 - gnunet/src/transport
Date: Tue, 15 Jun 2010 12:01:49 +0200

Author: wachs
Date: 2010-06-15 12:01:49 +0200 (Tue, 15 Jun 2010)
New Revision: 11753

Modified:
   gnunet/src/transport/plugin_transport_http.c
   gnunet/src/transport/test_plugin_transport_http.c
Log:


Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c        2010-06-14 19:18:24 UTC 
(rev 11752)
+++ gnunet/src/transport/plugin_transport_http.c        2010-06-15 10:01:49 UTC 
(rev 11753)
@@ -1358,17 +1358,18 @@
   if ((addrlen != sizeof (struct IPv4HttpAddress)) &&
       (addrlen != sizeof (struct IPv6HttpAddress)))
     {
-      GNUNET_break_op (0);
       return GNUNET_SYSERR;
     }
   if (addrlen == sizeof (struct IPv4HttpAddress))
     {
       v4 = (struct IPv4HttpAddress *) addr;
-
+      if (INADDR_LOOPBACK == ntohl(v4->ipv4_addr))
+      {
+        return GNUNET_SYSERR;
+      }
       port = ntohs (v4->u_port);
       if (port != plugin->port_inbound)
       {
-        GNUNET_break_op (0);
         return GNUNET_SYSERR;
       }
     }
@@ -1377,17 +1378,16 @@
       v6 = (struct IPv6HttpAddress *) addr;
       if (IN6_IS_ADDR_LINKLOCAL (&v6->ipv6_addr))
         {
-          GNUNET_break_op (0);
           return GNUNET_SYSERR;
         }
       port = ntohs (v6->u6_port);
       if (port != plugin->port_inbound)
       {
-        GNUNET_break_op (0);
         return GNUNET_SYSERR;
       }
+    }
 
-    }
+
   return GNUNET_OK;
 }
 

Modified: gnunet/src/transport/test_plugin_transport_http.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_http.c   2010-06-14 19:18:24 UTC 
(rev 11752)
+++ gnunet/src/transport/test_plugin_transport_http.c   2010-06-15 10:01:49 UTC 
(rev 11753)
@@ -1090,20 +1090,20 @@
 
   /* Suggesting addresses with wrong port*/
   struct IPv4HttpAddress failing_addr;
-  failing_addr.ipv4_addr = INADDR_LOOPBACK;
-  failing_addr.u_port = 0;
+  failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK);
+  failing_addr.u_port = htons(0);
   suggest_res = api->check_address (NULL,&failing_addr,sizeof (struct 
IPv4HttpAddress));
   GNUNET_assert (GNUNET_SYSERR == suggest_res);
 
   /* Suggesting addresses with wrong size*/
-  failing_addr.ipv4_addr = INADDR_LOOPBACK;
-  failing_addr.u_port = 0;
+  failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK);
+  failing_addr.u_port = htons(0);
   suggest_res = api->check_address (NULL,&failing_addr,sizeof (struct 
IPv6HttpAddress));
   GNUNET_assert (GNUNET_SYSERR == suggest_res);
 
   /* Suggesting addresses with wrong address*/
-  failing_addr.ipv4_addr = 0;
-  failing_addr.u_port = 12389;
+  failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK);
+  failing_addr.u_port = htons(12389);
   suggest_res = api->check_address (NULL,&failing_addr,sizeof (struct 
IPv4HttpAddress));
   GNUNET_assert (GNUNET_SYSERR == suggest_res);
 




reply via email to

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