Commit 4f5b991e authored by Fabrice Bellet's avatar Fabrice Bellet

interfaces: ignore predefined network interfaces

Some interfaces, like the one managed by libvirtd to provide a network
bridge to locally hosted virtual machines, can be completely ignored
when gathering ICE candidates. The motivation for adding this
possibility is that, ignoring them doesn't remove capabilities, and
improves the overall speed of the connection check method, by reducing
the number of pairs to be tested. This patch adds the possibility to
define such interfaces in the configuration script.

Differential Revision: https://phabricator.freedesktop.org/D948
parent d5446a72
......@@ -276,6 +276,11 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
nice_debug ("Ignoring loopback interface");
g_free (addr_string);
}
#ifdef IGNORED_IFACE_PREFIX
} else if (g_str_has_prefix (ifa->ifa_name, IGNORED_IFACE_PREFIX)) {
nice_debug ("Ignoring %s interface", ifa->ifa_name);
g_free (addr_string);
#endif
} else {
if (nice_interfaces_is_private_ip (ifa->ifa_addr))
ips = add_ip_to_list (ips, addr_string, TRUE);
......
......@@ -354,6 +354,20 @@ AM_CONDITIONAL([ENABLE_GTK_DOC], false)
# GObject introspection
GOBJECT_INTROSPECTION_CHECK([1.30.0])
dnl Ignore a specific network interface name prefix from the connection check
AC_MSG_CHECKING([whether to ignore a specific network interface name prefix])
AC_ARG_WITH([ignored-network-interface-prefix],
[AS_HELP_STRING([--with-ignored-network-interface-prefix=string],
[Ignore network interfaces whose name starts with "string" from the ICE connection
check algorithm. For example, interfaces "virbr" in the case of the virtual bridge
handled by libvirtd, do not help in finding connectivity.])],
[interface_prefix="$withval"])
AS_IF([test -n "$interface_prefix"],
[AC_DEFINE_UNQUOTED([IGNORED_IFACE_PREFIX],["$interface_prefix"],
[Ignore this network interface prefix from the connection check])
AC_MSG_RESULT([yes, $interface_prefix])],
[AC_MSG_RESULT([no])])
AC_CONFIG_MACRO_DIR(m4)
AC_OUTPUT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment