Commit b4abda09 authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête
Browse files

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:
parent d5446a72
......@@ -276,6 +276,12 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
nice_debug ("Ignoring loopback interface");
g_free (addr_string);
} else if (g_str_has_prefix (ifa->ifa_name, IGNORED_IFACE_PREFIX)) {
nice_debug ("Ignoring interface %s as it matches prefix %s",
ifa->ifa_name, IGNORED_IFACE_PREFIX);
g_free (addr_string);
} 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
dnl Ignore a specific network interface name prefix from the connection check
AC_MSG_CHECKING([whether to ignore a specific network interface name prefix])
[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.])],
AS_IF([test -n "$interface_prefix"],
[Ignore this network interface prefix from the connection check])
AC_MSG_RESULT([yes, $interface_prefix])],
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