commit 3d1b8b823e1d10ebcf94e02868c6e24b762a07fc
parent e99757657ac5245b22203026e15441cd5c662a4f
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 7 Jul 2015 21:41:29 +0000
do not add our virtual interfaces to our HELLO
Diffstat:
| M | src/nat/nat.c | | | 54 | +++++++++++++++++++++++++++++++++++++++++++++++++++--- |
1 file changed, 51 insertions(+), 3 deletions(-)
diff --git a/src/nat/nat.c b/src/nat/nat.c
@@ -69,7 +69,7 @@ enum LocalAddressSource
* 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 @@ process_hostname_ip (void *cls,
* @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,6 +680,51 @@ process_interfaces (void *cls, const char *name, int isDefault,
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)
{