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;
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);
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);
#include "gnunet_nat_lib.h"
-#define VERBOSE GNUNET_NO
-
-
/**
* Time to wait before stopping NAT, in seconds
*/
"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;
}
# 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;
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;
}
[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;
# 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;