gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r31377 - gnunet/src/nat
Date: Fri, 13 Dec 2013 20:38:18 +0100

Author: grothoff
Date: 2013-12-13 20:38:18 +0100 (Fri, 13 Dec 2013)
New Revision: 31377

Modified:
   gnunet/src/nat/nat.c
Log:
remove external IP address from previous DNS lookup only after DNS lookup for 
new iteration has completed (#3213)

Modified: gnunet/src/nat/nat.c
===================================================================
--- gnunet/src/nat/nat.c        2013-12-13 19:32:02 UTC (rev 31376)
+++ gnunet/src/nat/nat.c        2013-12-13 19:38:18 UTC (rev 31377)
@@ -71,6 +71,13 @@
   LAL_EXTERNAL_IP,
 
   /**
+   * Address was obtained by DNS resolution of the external hostname
+   * given in the configuration (i.e. hole-punched DynDNS setup)
+   * during the previous iteration (see #3213).
+   */
+  LAL_EXTERNAL_IP_OLD,
+
+  /**
    * Address was obtained by looking up our own hostname in DNS.
    */
   LAL_HOSTNAME_DNS,
@@ -579,6 +586,8 @@
   if (NULL == addr)
   {
     h->ext_dns = NULL;
+    /* Current iteration is over, remove 'old' IPs now */
+    remove_from_address_list_by_source (h, LAL_EXTERNAL_IP);
     if (1 == inet_pton (AF_INET,
                         h->external_address,
                         &dummy))
@@ -967,10 +976,12 @@
              const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_NAT_Handle *h = cls;
+  struct LocalAddressList *pos;
 
   h->dns_task = GNUNET_SCHEDULER_NO_TASK;
-  /* NOTE #3213, bugnote #7878 */
-  remove_from_address_list_by_source (h, LAL_EXTERNAL_IP);
+  for (pos = h->lal_head; NULL != pos; pos = pos->next)
+    if (pos->source == LAL_EXTERNAL_IP)
+      pos->source = LAL_EXTERNAL_IP_OLD;
   h->ext_dns =
       GNUNET_RESOLVER_ip_get (h->external_address, AF_INET,
                               GNUNET_TIME_UNIT_MINUTES,




reply via email to

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