gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r15829 - in gnunet: contrib src/nat


From: gnunet
Subject: [GNUnet-SVN] r15829 - in gnunet: contrib src/nat
Date: Mon, 4 Jul 2011 10:18:00 +0200

Author: grothoff
Date: 2011-07-04 10:18:00 +0200 (Mon, 04 Jul 2011)
New Revision: 15829

Modified:
   gnunet/contrib/defaults.conf
   gnunet/src/nat/nat.c
Log:
option to not do DNS lookup of hostname

Modified: gnunet/contrib/defaults.conf
===================================================================
--- gnunet/contrib/defaults.conf        2011-07-04 08:12:31 UTC (rev 15828)
+++ gnunet/contrib/defaults.conf        2011-07-04 08:18:00 UTC (rev 15829)
@@ -34,6 +34,9 @@
 # Use addresses from the local network interfaces (inluding loopback, but also 
others)
 USE_LOCALADDR = YES
 
+# Use address obtained from a DNS lookup of our hostname
+USE_HOSTNAME = NO
+
 # 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; 
 # possibly auto-detected (using UPnP) if possible if not specified

Modified: gnunet/src/nat/nat.c
===================================================================
--- gnunet/src/nat/nat.c        2011-07-04 08:12:31 UTC (rev 15828)
+++ gnunet/src/nat/nat.c        2011-07-04 08:18:00 UTC (rev 15829)
@@ -281,6 +281,11 @@
   int use_localaddresses;
 
   /**
+   * Should we do a DNS lookup of our hostname to find out our own IP?
+   */
+  int use_hostname;
+
+  /**
    * Is using IPv6 disabled?
    */
   int disable_ipv6;
@@ -1144,6 +1149,9 @@
   h->use_localaddresses = GNUNET_CONFIGURATION_get_value_yesno (cfg,
                                                                "nat",
                                                                
"USE_LOCALADDR");
+  h->use_hostname = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+                                                         "nat",
+                                                         "USE_HOSTNAME");
   if (h->use_localaddresses)
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "USE LOCALADDR enabled!\n");
   h->disable_ipv6 = GNUNET_CONFIGURATION_get_value_yesno(cfg,
@@ -1206,8 +1214,9 @@
 
   if (NULL != h->address_callback)
     {
-      h->ifc_task = GNUNET_SCHEDULER_add_now (&list_interfaces, h);
-      h->hostname_task = GNUNET_SCHEDULER_add_now (&resolve_hostname, h);
+      h->ifc_task = GNUNET_SCHEDULER_add_now (&list_interfaces, h);    
+      if (GNUNET_YES == h->use_hostname)
+       h->hostname_task = GNUNET_SCHEDULER_add_now (&resolve_hostname, h);
     }
   return h;
 }




reply via email to

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