gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21540 - gnunet/src/nat


From: gnunet
Subject: [GNUnet-SVN] r21540 - gnunet/src/nat
Date: Thu, 17 May 2012 17:47:54 +0200

Author: grothoff
Date: 2012-05-17 17:47:54 +0200 (Thu, 17 May 2012)
New Revision: 21540

Modified:
   gnunet/src/nat/nat_test.c
   gnunet/src/nat/test_nat.c
   gnunet/src/nat/test_nat_data.conf
   gnunet/src/nat/test_nat_test.c
   gnunet/src/nat/test_nat_test_data.conf
Log:
-fix

Modified: gnunet/src/nat/nat_test.c
===================================================================
--- gnunet/src/nat/nat_test.c   2012-05-16 23:16:28 UTC (rev 21539)
+++ gnunet/src/nat/nat_test.c   2012-05-17 15:47:54 UTC (rev 21540)
@@ -318,7 +318,12 @@
   if (GNUNET_YES != add_remove)
     return;
   if (addrlen != sizeof (struct sockaddr_in))
+  {
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+        "NAT test ignores IPv6 address `%s' returned from NAT library\n",
+        GNUNET_a2s (addr, addrlen));
     return;                     /* ignore IPv6 here */
+  }
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Asking gnunet-nat-server to connect to 
`%s'\n",
        GNUNET_a2s (addr, addrlen));
   sa = (const struct sockaddr_in *) addr;
@@ -424,6 +429,10 @@
           GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                          ret->lsock, &do_udp_read, ret);
     }
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+        "NAT test listens on port %u (%s)\n",
+        bnd_port,
+        (GNUNET_YES == is_tcp) ? "tcp" : "udp");
     ret->nat =
         GNUNET_NAT_register (cfg, is_tcp, adv_port, 1, addrs, addrlens,
                              &addr_cb, NULL, ret);
@@ -443,6 +452,8 @@
   struct NatActivity *pos;
   struct ClientActivity *cpos;
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Stopping NAT test\n");
   while (NULL != (cpos = tst->ca_head))
   {
     GNUNET_CONTAINER_DLL_remove (tst->ca_head, tst->ca_tail, cpos);

Modified: gnunet/src/nat/test_nat.c
===================================================================
--- gnunet/src/nat/test_nat.c   2012-05-16 23:16:28 UTC (rev 21539)
+++ gnunet/src/nat/test_nat.c   2012-05-17 15:47:54 UTC (rev 21540)
@@ -41,9 +41,6 @@
 #include "gnunet_nat_lib.h"
 
 
-#define VERBOSE GNUNET_NO
-
-
 /**
  * Time to wait before stopping NAT, in seconds
  */
@@ -164,28 +161,14 @@
     "test-nat",
     "-c",
     "test_nat_data.conf",
-    "-L",
-#if VERBOSE
-    "DEBUG",
-#else
-    "WARNING",
-#endif
     NULL
   };
-
   GNUNET_log_setup ("test-nat",
-#if VERBOSE
-                    "DEBUG",
-#else
                     "WARNING",
-#endif
                     NULL);
-
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Testing NAT library, timeout set to %d seconds\n", TIMEOUT);
-
-  GNUNET_PROGRAM_run (5, argv_prog, "test-nat", "nohelp", options, &run, NULL);
-
+  GNUNET_PROGRAM_run (3, argv_prog, "test-nat", "nohelp", options, &run, NULL);
   return 0;
 }
 

Modified: gnunet/src/nat/test_nat_data.conf
===================================================================
--- gnunet/src/nat/test_nat_data.conf   2012-05-16 23:16:28 UTC (rev 21539)
+++ gnunet/src/nat/test_nat_data.conf   2012-05-17 15:47:54 UTC (rev 21540)
@@ -36,8 +36,8 @@
 
 # Should we use ICMP-based NAT traversal to try connect to NATed peers
 # or, if we are behind NAT, to allow connections to us?
-ENABLE_ICMP_CLIENT = YES
-ENABLE_ICMP_SERVER = YES
+ENABLE_ICMP_CLIENT = NO
+ENABLE_ICMP_SERVER = NO
 
 # IP address of the interface connected to the NAT box; IPv4 dotted-decimal 
ONLY;
 # normal interface IP address for non-NATed peers; 

Modified: gnunet/src/nat/test_nat_test.c
===================================================================
--- gnunet/src/nat/test_nat_test.c      2012-05-16 23:16:28 UTC (rev 21539)
+++ gnunet/src/nat/test_nat_test.c      2012-05-17 15:47:54 UTC (rev 21540)
@@ -111,6 +111,8 @@
   GNUNET_break (0 == GNUNET_OS_process_kill (gns, SIGTERM));
   GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (gns));
   GNUNET_OS_process_destroy (gns);
+  if (0 != ret)
+    fprintf (stderr, "NAT test failed to report success\n");
   return ret;
 }
 

Modified: gnunet/src/nat/test_nat_test_data.conf
===================================================================
--- gnunet/src/nat/test_nat_test_data.conf      2012-05-16 23:16:28 UTC (rev 
21539)
+++ gnunet/src/nat/test_nat_test_data.conf      2012-05-17 15:47:54 UTC (rev 
21540)
@@ -12,16 +12,17 @@
 
 [nat]
 # Are we behind NAT?
-BEHIND_NAT = YES
+BEHIND_NAT = NO
 
 # Is the NAT hole-punched?
-PUNCHED_NAT = NO
+PUNCHED_NAT = YES
 
 # Disable UPNP by default until it gets cleaner!
-ENABLE_UPNP = YES
+ENABLE_UPNP = NO
 
 # Use addresses from the local network interfaces (inluding loopback, but also 
others)
 USE_LOCALADDR = YES
+RETURN_LOCAL_ADDRESSES = YES
 
 # External IP address of the NAT box (if known); IPv4 dotted-decimal ONLY at 
this time (should allow DynDNS!)
 # normal interface IP address for non-NATed peers; 
@@ -30,8 +31,8 @@
 
 # Should we use ICMP-based NAT traversal to try connect to NATed peers
 # or, if we are behind NAT, to allow connections to us?
-ENABLE_ICMP_CLIENT = YES
-ENABLE_ICMP_SERVER = YES
+ENABLE_ICMP_CLIENT = NO
+ENABLE_ICMP_SERVER = NO
 
 # IP address of the interface connected to the NAT box; IPv4 dotted-decimal 
ONLY;
 # normal interface IP address for non-NATed peers; 




reply via email to

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