gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r36055 - gnunet/src/nat
Date: Tue, 7 Jul 2015 23:41:29 +0200

Author: grothoff
Date: 2015-07-07 23:41:29 +0200 (Tue, 07 Jul 2015)
New Revision: 36055

Modified:
   gnunet/src/nat/nat.c
Log:
do not add our virtual interfaces to our HELLO

Modified: gnunet/src/nat/nat.c
===================================================================
--- gnunet/src/nat/nat.c        2015-07-07 21:04:17 UTC (rev 36054)
+++ gnunet/src/nat/nat.c        2015-07-07 21:41:29 UTC (rev 36055)
@@ -69,7 +69,7 @@
    * given in the configuration (i.e. hole-punched DynDNS setup).
    */
   LAL_EXTERNAL_IP,
-  
+
    /**
    * Address was obtained by an external STUN server
    */
@@ -664,10 +664,13 @@
  * @return #GNUNET_OK to continue iterating
  */
 static int
-process_interfaces (void *cls, const char *name, int isDefault,
+process_interfaces (void *cls,
+                    const char *name,
+                    int isDefault,
                     const struct sockaddr *addr,
                     const struct sockaddr *broadcast_addr,
-                    const struct sockaddr *netmask, socklen_t addrlen)
+                    const struct sockaddr *netmask,
+                    socklen_t addrlen)
 {
   const static struct in6_addr any6 = IN6ADDR_ANY_INIT;
   struct GNUNET_NAT_Handle *h = cls;
@@ -677,7 +680,52 @@
   char buf[INET6_ADDRSTRLEN];
   unsigned int i;
   int have_any;
+  char *tun_if;
 
+  /* skip virtual interfaces created by GNUnet-vpn */
+  if (GNUNET_OK ==
+      GNUNET_CONFIGURATION_get_value_string (h->cfg,
+                                             "vpn",
+                                             "IFNAME",
+                                             &tun_if))
+  {
+    if (0 == strcmp (name,
+                     tun_if))
+    {
+      GNUNET_free (tun_if);
+      return GNUNET_OK;
+    }
+  }
+  /* skip virtual interfaces created by GNUnet-dns */
+  if (GNUNET_OK ==
+      GNUNET_CONFIGURATION_get_value_string (h->cfg,
+                                             "dns",
+                                             "IFNAME",
+                                             &tun_if))
+  {
+    if (0 == strcmp (name,
+                     tun_if))
+    {
+      GNUNET_free (tun_if);
+      return GNUNET_OK;
+    }
+  }
+  /* skip virtual interfaces created by GNUnet-exit */
+  if (GNUNET_OK ==
+      GNUNET_CONFIGURATION_get_value_string (h->cfg,
+                                             "exit",
+                                             "EXIT_IFNAME",
+                                             &tun_if))
+  {
+    if (0 == strcmp (name,
+                     tun_if))
+    {
+      GNUNET_free (tun_if);
+      return GNUNET_OK;
+    }
+  }
+
+
   switch (addr->sa_family)
   {
   case AF_INET:




reply via email to

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