681 lines
25 KiB
Diff
681 lines
25 KiB
Diff
From 4df165dd9778f3b1bda8e5c7a1417275d86bd23f Mon Sep 17 00:00:00 2001
|
|
From: Seungha Yang <seungha.yang@navercorp.com>
|
|
Date: Tue, 21 May 2019 00:22:36 +0900
|
|
Subject: [PATCH 03/16] meson: Fix build with MSVC and non-English locale
|
|
|
|
Otherwise, MSVC will complain and cause build error.
|
|
---
|
|
meson.build | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/meson.build b/meson.build
|
|
index 72f90d7..c685e41 100644
|
|
--- a/meson.build
|
|
+++ b/meson.build
|
|
@@ -29,6 +29,12 @@ cc = meson.get_compiler('c')
|
|
|
|
syslibs = []
|
|
|
|
+if cc.get_id() == 'msvc'
|
|
+ add_project_arguments(
|
|
+ cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
|
+ language : 'c')
|
|
+endif
|
|
+
|
|
if host_machine.system() == 'windows'
|
|
syslibs += [cc.find_library('iphlpapi')]
|
|
syslibs += [cc.find_library('ws2_32')]
|
|
--
|
|
2.21.0
|
|
|
|
From ca47519feda9d4dad38a06e2f7d94c0afc501364 Mon Sep 17 00:00:00 2001
|
|
From: Jakub Adam <jakub.adam@collabora.com>
|
|
Date: Wed, 29 May 2019 20:10:40 +0200
|
|
Subject: [PATCH 04/16] conncheck: Don't lookup prflx pair for UDP candidates
|
|
|
|
Code comment mentions peer reflexive candidate pair should be selected
|
|
only in the case of TCP local candidates, but it was done in all cases.
|
|
---
|
|
agent/conncheck.c | 12 +++++++-----
|
|
1 file changed, 7 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/agent/conncheck.c b/agent/conncheck.c
|
|
index e931e24..3e02ce0 100644
|
|
--- a/agent/conncheck.c
|
|
+++ b/agent/conncheck.c
|
|
@@ -3033,11 +3033,13 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *
|
|
* of a TCP-ACTIVE local candidate, so we find it even if an incoming
|
|
* check matched an existing pair because it could be the original
|
|
* ACTIVE-PASSIVE candidate pair which was retriggered */
|
|
- for (i = stream->conncheck_list; i; i = i->next) {
|
|
- CandidateCheckPair *pair = i->data;
|
|
- if (pair->local == cand && remote_candidate == pair->remote) {
|
|
- new_pair = pair;
|
|
- break;
|
|
+ if (local_cand->transport != NICE_CANDIDATE_TRANSPORT_UDP) {
|
|
+ for (i = stream->conncheck_list; i; i = i->next) {
|
|
+ CandidateCheckPair *pair = i->data;
|
|
+ if (pair->local == cand && remote_candidate == pair->remote) {
|
|
+ new_pair = pair;
|
|
+ break;
|
|
+ }
|
|
}
|
|
}
|
|
break;
|
|
--
|
|
2.21.0
|
|
|
|
From 083ac5a95c80e97c21a244cdc2c249255d0d7268 Mon Sep 17 00:00:00 2001
|
|
From: alex <alex@meetecho.com>
|
|
Date: Tue, 21 May 2019 16:19:32 +0200
|
|
Subject: [PATCH 05/16] Fix regression introduced by
|
|
https://gitlab.freedesktop.org/libnice/libnice/commit/da41258a21102f63ec5d5b2dc20d303f772eb195.
|
|
Fix #64.
|
|
|
|
---
|
|
socket/udp-turn.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/socket/udp-turn.c b/socket/udp-turn.c
|
|
index b665edc..ddf4aa8 100644
|
|
--- a/socket/udp-turn.c
|
|
+++ b/socket/udp-turn.c
|
|
@@ -1199,6 +1199,7 @@ priv_binding_timeout (gpointer data)
|
|
/* find current binding and mark it for renewal */
|
|
for (i = priv->channels ; i; i = i->next) {
|
|
ChannelBinding *b = i->data;
|
|
+ source = g_main_current_source ();
|
|
if (b->timeout_source == source) {
|
|
b->renew = TRUE;
|
|
|
|
--
|
|
2.21.0
|
|
|
|
From 1ff29177d4ae4f1f2eff108c9f2e506f41072282 Mon Sep 17 00:00:00 2001
|
|
From: alex <alex@meetecho.com>
|
|
Date: Wed, 5 Jun 2019 11:45:17 +0200
|
|
Subject: [PATCH 06/16] Assign source out of the for loop
|
|
|
|
---
|
|
socket/udp-turn.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/socket/udp-turn.c b/socket/udp-turn.c
|
|
index ddf4aa8..ce6a8fd 100644
|
|
--- a/socket/udp-turn.c
|
|
+++ b/socket/udp-turn.c
|
|
@@ -1195,11 +1195,12 @@ priv_binding_timeout (gpointer data)
|
|
}
|
|
|
|
nice_debug ("Permission is about to timeout, sending binding renewal");
|
|
+ source = g_main_current_source ();
|
|
|
|
/* find current binding and mark it for renewal */
|
|
for (i = priv->channels ; i; i = i->next) {
|
|
ChannelBinding *b = i->data;
|
|
- source = g_main_current_source ();
|
|
+
|
|
if (b->timeout_source == source) {
|
|
b->renew = TRUE;
|
|
|
|
--
|
|
2.21.0
|
|
|
|
From 3eab4bc45625b92878cceed8f0d33132655f9921 Mon Sep 17 00:00:00 2001
|
|
From: Stefan Becker <chemobejk@gmail.com>
|
|
Date: Wed, 26 Jun 2019 11:00:25 +0300
|
|
Subject: [PATCH 07/16] interfaces: support multiple loopbacks
|
|
|
|
Clone implementation from HAVE_GETIFADDRS branch to !HAVE_GETIFADDRS
|
|
branch of nice_interfaces_get_local_ips()
|
|
---
|
|
agent/interfaces.c | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/agent/interfaces.c b/agent/interfaces.c
|
|
index f3f6d7f..b0bb0e3 100644
|
|
--- a/agent/interfaces.c
|
|
+++ b/agent/interfaces.c
|
|
@@ -309,7 +309,7 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
struct ifreq *ifr;
|
|
struct ifconf ifc;
|
|
struct sockaddr_in *sa;
|
|
- gchar *loopback = NULL;
|
|
+ GList *loopbacks = NULL;
|
|
|
|
if ((sockfd = socket (AF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0) {
|
|
nice_debug ("Error : Cannot open socket to retrieve interface list");
|
|
@@ -355,7 +355,7 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
nice_debug ("IP Address: %s", inet_ntoa (sa->sin_addr));
|
|
if ((ifr->ifr_flags & IFF_LOOPBACK) == IFF_LOOPBACK){
|
|
if (include_loopback)
|
|
- loopback = g_strdup (inet_ntoa (sa->sin_addr));
|
|
+ loopbacks = add_ip_to_list (loopbacks, g_strdup (inet_ntoa (sa->sin_addr)), TRUE);
|
|
else
|
|
nice_debug ("Ignoring loopback interface");
|
|
} else {
|
|
@@ -370,8 +370,8 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
close (sockfd);
|
|
free (ifc.ifc_req);
|
|
|
|
- if (loopback)
|
|
- ips = add_ip_to_list (ips, loopback, TRUE);
|
|
+ if (loopbacks)
|
|
+ ips = g_list_concat (ips, loopbacks);
|
|
|
|
return ips;
|
|
}
|
|
--
|
|
2.21.0
|
|
|
|
From 9c93234be8c3e4ed612453b27bfd6615cbc748ad Mon Sep 17 00:00:00 2001
|
|
From: Stefan Becker <chemobejk@gmail.com>
|
|
Date: Wed, 26 Jun 2019 11:08:37 +0300
|
|
Subject: [PATCH 08/16] interfaces: add missing support for
|
|
IGNORED_IFACE_PREFIX
|
|
|
|
This fixes commit b4abda09c79e4ce372a3771300abf568c85c7ff5
|
|
|
|
Copy the implementation to the !HAVE_GETIFADDRS branch too.
|
|
---
|
|
agent/interfaces.c | 5 +++++
|
|
1 file changed, 5 insertions(+)
|
|
|
|
diff --git a/agent/interfaces.c b/agent/interfaces.c
|
|
index b0bb0e3..0dc4b0d 100644
|
|
--- a/agent/interfaces.c
|
|
+++ b/agent/interfaces.c
|
|
@@ -358,6 +358,11 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
loopbacks = add_ip_to_list (loopbacks, g_strdup (inet_ntoa (sa->sin_addr)), TRUE);
|
|
else
|
|
nice_debug ("Ignoring loopback interface");
|
|
+#ifdef IGNORED_IFACE_PREFIX
|
|
+ } else if (g_str_has_prefix (ifr->ifr_name, IGNORED_IFACE_PREFIX)) {
|
|
+ nice_debug ("Ignoring interface %s as it matches prefix %s",
|
|
+ ifr->ifr_name, IGNORED_IFACE_PREFIX);
|
|
+#endif
|
|
} else {
|
|
if (nice_interfaces_is_private_ip ((struct sockaddr *) sa)) {
|
|
ips = add_ip_to_list (ips, g_strdup (inet_ntoa (sa->sin_addr)), TRUE);
|
|
--
|
|
2.21.0
|
|
|
|
From e920a99518b3e8812f779dd7b5d809b8ac97dcd2 Mon Sep 17 00:00:00 2001
|
|
From: Stefan Becker <chemobejk@gmail.com>
|
|
Date: Wed, 26 Jun 2019 11:45:06 +0300
|
|
Subject: [PATCH 09/16] interfaces: detect IPv6 ULA & link-local addresses
|
|
|
|
Update nice_interfaces_is_private_ip() to handle IPv6 too:
|
|
|
|
- unique local address block: fc00::/7
|
|
- link-local address block: fe80::/10
|
|
---
|
|
agent/interfaces.c | 10 ++++++++++
|
|
1 file changed, 10 insertions(+)
|
|
|
|
diff --git a/agent/interfaces.c b/agent/interfaces.c
|
|
index 0dc4b0d..f8bb086 100644
|
|
--- a/agent/interfaces.c
|
|
+++ b/agent/interfaces.c
|
|
@@ -193,6 +193,7 @@ nice_interfaces_is_private_ip (const struct sockaddr *_sa)
|
|
union {
|
|
const struct sockaddr *addr;
|
|
const struct sockaddr_in *in;
|
|
+ const struct sockaddr_in6 *in6;
|
|
} sa;
|
|
|
|
sa.addr = _sa;
|
|
@@ -213,6 +214,15 @@ nice_interfaces_is_private_ip (const struct sockaddr *_sa)
|
|
/* 169.254.x.x/16 (for APIPA) */
|
|
if (sa.in->sin_addr.s_addr >> 16 == 0xA9FE)
|
|
return TRUE;
|
|
+ } else if (sa.addr->sa_family == AF_INET6) {
|
|
+ /* fc00::/7 Unique local address (ULA) */
|
|
+ if ((sa.in6->sin6_addr.s6_addr[0] & 0xFE) == 0xFC)
|
|
+ return TRUE;
|
|
+
|
|
+ /* fe80::/10 link-local address */
|
|
+ if ( (sa.in6->sin6_addr.s6_addr[0] == 0xFE) &&
|
|
+ ((sa.in6->sin6_addr.s6_addr[1] & 0xC0) == 0x80))
|
|
+ return TRUE;
|
|
}
|
|
|
|
return FALSE;
|
|
--
|
|
2.21.0
|
|
|
|
From 0245565e056b7a919d92033eada4c090ebc436e9 Mon Sep 17 00:00:00 2001
|
|
From: Stefan Becker <chemobejk@gmail.com>
|
|
Date: Wed, 26 Jun 2019 12:00:21 +0300
|
|
Subject: [PATCH 11/16] interfaces: ignore non-running interfaces
|
|
|
|
Check for IFF_UP and IFF_RUNNING flags on the interface.
|
|
---
|
|
agent/interfaces.c | 13 +++++++++++++
|
|
1 file changed, 13 insertions(+)
|
|
|
|
diff --git a/agent/interfaces.c b/agent/interfaces.c
|
|
index f8bb086..3bfae3e 100644
|
|
--- a/agent/interfaces.c
|
|
+++ b/agent/interfaces.c
|
|
@@ -266,6 +266,10 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
if ((ifa->ifa_flags & IFF_UP) == 0)
|
|
continue;
|
|
|
|
+ /* no ip address from interface that isn't running */
|
|
+ if ((ifa->ifa_flags & IFF_RUNNING) == 0)
|
|
+ continue;
|
|
+
|
|
if (ifa->ifa_addr == NULL)
|
|
continue;
|
|
|
|
@@ -360,6 +364,15 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
" Skipping...", ifr->ifr_name);
|
|
continue; /* failed to get flags, skip it */
|
|
}
|
|
+
|
|
+ /* no ip address from interface that is down */
|
|
+ if ((ifr->ifr_flags & IFF_UP) == 0)
|
|
+ continue;
|
|
+
|
|
+ /* no ip address from interface that isn't running */
|
|
+ if ((ifr->ifr_flags & IFF_RUNNING) == 0)
|
|
+ continue;
|
|
+
|
|
sa = (struct sockaddr_in *) &ifr->ifr_addr;
|
|
nice_debug ("Interface: %s", ifr->ifr_name);
|
|
nice_debug ("IP Address: %s", inet_ntoa (sa->sin_addr));
|
|
--
|
|
2.21.0
|
|
|
|
From 7b4b46f97c2d37da38eba4637dcf040105269772 Mon Sep 17 00:00:00 2001
|
|
From: Stefan Becker <chemobejk@gmail.com>
|
|
Date: Thu, 27 Jun 2019 12:17:43 +0300
|
|
Subject: [PATCH 12/16] interfaces: allow list of ignored prefixes
|
|
|
|
Improve on commit b4abda09c79e4ce372a3771300abf568c85c7ff5
|
|
|
|
Instead of checking one prefix, check against a list of prefixes. This
|
|
allows libnice to be configured to ignore interfaces from virtual
|
|
machines and containers.
|
|
---
|
|
agent/interfaces.c | 72 ++++++++++++++++++++++++++++++++++------------
|
|
1 file changed, 53 insertions(+), 19 deletions(-)
|
|
|
|
diff --git a/agent/interfaces.c b/agent/interfaces.c
|
|
index 3bfae3e..3a3b39c 100644
|
|
--- a/agent/interfaces.c
|
|
+++ b/agent/interfaces.c
|
|
@@ -73,6 +73,13 @@
|
|
|
|
#endif /* G_OS_UNIX */
|
|
|
|
+#ifdef IGNORED_IFACE_PREFIX
|
|
+static const gchar *ignored_iface_prefix_list[] = {
|
|
+ IGNORED_IFACE_PREFIX,
|
|
+ NULL
|
|
+};
|
|
+#endif
|
|
+
|
|
#if (defined(G_OS_UNIX) && defined(HAVE_GETIFADDRS)) || defined(G_OS_WIN32)
|
|
/* Works on both UNIX and Windows. Magic! */
|
|
static gchar *
|
|
@@ -253,7 +260,10 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
GList *ips = NULL;
|
|
struct ifaddrs *ifa, *results;
|
|
GList *loopbacks = NULL;
|
|
-
|
|
+#ifdef IGNORED_IFACE_PREFIX
|
|
+ const gchar **prefix;
|
|
+ gboolean ignored = FALSE;
|
|
+#endif
|
|
|
|
if (getifaddrs (&results) < 0)
|
|
return NULL;
|
|
@@ -290,18 +300,28 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
nice_debug ("Ignoring loopback interface");
|
|
g_free (addr_string);
|
|
}
|
|
+ continue;
|
|
+ }
|
|
+
|
|
#ifdef IGNORED_IFACE_PREFIX
|
|
- } 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);
|
|
-#endif
|
|
- } else {
|
|
- if (nice_interfaces_is_private_ip (ifa->ifa_addr))
|
|
- ips = add_ip_to_list (ips, addr_string, TRUE);
|
|
- else
|
|
- ips = add_ip_to_list (ips, addr_string, FALSE);
|
|
+ for (prefix = ignored_iface_prefix_list; *prefix; prefix++) {
|
|
+ if (g_str_has_prefix (ifa->ifa_name, *prefix)) {
|
|
+ nice_debug ("Ignoring interface %s as it matches prefix %s",
|
|
+ ifa->ifa_name, *prefix);
|
|
+ g_free (addr_string);
|
|
+ ignored = true;
|
|
+ break;
|
|
+ }
|
|
}
|
|
+
|
|
+ if (ignored)
|
|
+ continue;
|
|
+#endif
|
|
+
|
|
+ if (nice_interfaces_is_private_ip (ifa->ifa_addr))
|
|
+ ips = add_ip_to_list (ips, addr_string, TRUE);
|
|
+ else
|
|
+ ips = add_ip_to_list (ips, addr_string, FALSE);
|
|
}
|
|
|
|
freeifaddrs (results);
|
|
@@ -324,6 +344,10 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
struct ifconf ifc;
|
|
struct sockaddr_in *sa;
|
|
GList *loopbacks = NULL;
|
|
+#ifdef IGNORED_IFACE_PREFIX
|
|
+ const gchar **prefix;
|
|
+ gboolean ignored = FALSE;
|
|
+#endif
|
|
|
|
if ((sockfd = socket (AF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0) {
|
|
nice_debug ("Error : Cannot open socket to retrieve interface list");
|
|
@@ -381,17 +405,27 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
|
|
loopbacks = add_ip_to_list (loopbacks, g_strdup (inet_ntoa (sa->sin_addr)), TRUE);
|
|
else
|
|
nice_debug ("Ignoring loopback interface");
|
|
+ continue;
|
|
+ }
|
|
+
|
|
#ifdef IGNORED_IFACE_PREFIX
|
|
- } else if (g_str_has_prefix (ifr->ifr_name, IGNORED_IFACE_PREFIX)) {
|
|
- nice_debug ("Ignoring interface %s as it matches prefix %s",
|
|
- ifr->ifr_name, IGNORED_IFACE_PREFIX);
|
|
+ for (prefix = ignored_iface_prefix_list; *prefix; prefix++) {
|
|
+ if (g_str_has_prefix (ifr->ifr_name, *prefix)) {
|
|
+ nice_debug ("Ignoring interface %s as it matches prefix %s",
|
|
+ ifr->ifr_name, *prefix);
|
|
+ ignored = true;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (ignored)
|
|
+ continue;
|
|
#endif
|
|
+
|
|
+ if (nice_interfaces_is_private_ip ((struct sockaddr *) sa)) {
|
|
+ ips = add_ip_to_list (ips, g_strdup (inet_ntoa (sa->sin_addr)), TRUE);
|
|
} else {
|
|
- if (nice_interfaces_is_private_ip ((struct sockaddr *) sa)) {
|
|
- ips = add_ip_to_list (ips, g_strdup (inet_ntoa (sa->sin_addr)), TRUE);
|
|
- } else {
|
|
- ips = add_ip_to_list (ips, g_strdup (inet_ntoa (sa->sin_addr)), FALSE);
|
|
- }
|
|
+ ips = add_ip_to_list (ips, g_strdup (inet_ntoa (sa->sin_addr)), FALSE);
|
|
}
|
|
}
|
|
|
|
--
|
|
2.21.0
|
|
|
|
From d4bc4fa35b5ea745195d116e1329fac6ad28dd5b Mon Sep 17 00:00:00 2001
|
|
From: Stefan Becker <chemobejk@gmail.com>
|
|
Date: Thu, 27 Jun 2019 12:22:53 +0300
|
|
Subject: [PATCH 13/16] build: make prefix option accept a list of strings
|
|
|
|
The parameter for the ignored network interface prefix build option
|
|
accepts a comma-separated string now. This list will be converted to a
|
|
comma-separated list of string literals for the C code.
|
|
|
|
Disable the feature:
|
|
|
|
./configure ...
|
|
./configure --with-ignored-network-interface-prefix= ...
|
|
meson setup -D ignored-network-interface-prefix= ...
|
|
meson setup -D ignored-network-interface-prefix=[] ...
|
|
|
|
Ignore interfaces whose names start with "virbr":
|
|
|
|
./configure --with-ignored-network-interface-prefix=virbr ...
|
|
meson setup -D ignored-network-interface-prefix=virbr ...
|
|
|
|
Ignore interfaces whose names start with "virbr" or "veth":
|
|
|
|
./configure --with-ignored-network-interface-prefix=virbr,veth ...
|
|
meson setup -D ignored-network-interface-prefix=virbr,veth ...
|
|
---
|
|
configure.ac | 11 ++++++-----
|
|
meson.build | 8 ++++++--
|
|
meson_options.txt | 4 ++--
|
|
3 files changed, 14 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
index 147b033..5254154 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -395,16 +395,17 @@ 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])
|
|
+dnl Ignore specific network interface name prefixes from the connection check
|
|
+AC_MSG_CHECKING([whether to ignore specific network interface name prefixes])
|
|
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
|
|
+ [AS_HELP_STRING([--with-ignored-network-interface-prefix=string@<:@,string...@:>@],
|
|
+ [Ignore network interfaces whose name starts with a string from this list in 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"],
|
|
+ [[interface_prefix_list=`echo $interface_prefix | sed 's/,/","/g'`]
|
|
+ AC_DEFINE_UNQUOTED([IGNORED_IFACE_PREFIX],["$interface_prefix_list"],
|
|
[Ignore this network interface prefix from the connection check])
|
|
AC_MSG_RESULT([yes, $interface_prefix])],
|
|
[AC_MSG_RESULT([no])])
|
|
diff --git a/meson.build b/meson.build
|
|
index c685e41..114d7c6 100644
|
|
--- a/meson.build
|
|
+++ b/meson.build
|
|
@@ -232,8 +232,12 @@ nice_incs = include_directories('.', 'agent', 'random', 'socket', 'stun')
|
|
nice_deps = gio_deps + [gthread_dep, crypto_dep, gupnp_igd_dep] + syslibs
|
|
|
|
ignored_iface_prefix = get_option('ignored-network-interface-prefix')
|
|
-if ignored_iface_prefix != ''
|
|
- cdata.set_quoted('IGNORED_IFACE_PREFIX', ignored_iface_prefix)
|
|
+if ignored_iface_prefix != []
|
|
+ ignored_iface_prefix_quoted = []
|
|
+ foreach i : ignored_iface_prefix
|
|
+ ignored_iface_prefix_quoted += '"' + i + '"'
|
|
+ endforeach
|
|
+ cdata.set('IGNORED_IFACE_PREFIX', ','.join(ignored_iface_prefix_quoted))
|
|
endif
|
|
|
|
gir = find_program('g-ir-scanner', required : get_option('introspection'))
|
|
diff --git a/meson_options.txt b/meson_options.txt
|
|
index d3a0ab9..9f9f7d6 100644
|
|
--- a/meson_options.txt
|
|
+++ b/meson_options.txt
|
|
@@ -2,8 +2,8 @@ option('gupnp', type: 'feature', value: 'auto',
|
|
description: 'Enable or disable GUPnP IGD support')
|
|
option('gstreamer', type: 'feature', value: 'auto',
|
|
description: 'Enable or disable build of GStreamer plugins')
|
|
-option('ignored-network-interface-prefix', type: 'string', value: '',
|
|
- description: 'Ignore network interfaces whose name starts with this string in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.')
|
|
+option('ignored-network-interface-prefix', type: 'array', value: [],
|
|
+ description: 'Ignore network interfaces whose name starts with a string from this list in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.')
|
|
option('crypto-library', type: 'combo', choices : ['auto', 'gnutls', 'openssl'], value : 'auto')
|
|
|
|
# Common feature options
|
|
--
|
|
2.21.0
|
|
|
|
From 056de4aeed8def0e2942c8ebb74bb3bd96b44a93 Mon Sep 17 00:00:00 2001
|
|
From: Stefan Becker <chemobejk@gmail.com>
|
|
Date: Thu, 27 Jun 2019 12:41:06 +0300
|
|
Subject: [PATCH 14/16] configure: support
|
|
--without-ignored-network-interface-prefix
|
|
|
|
This fixes commit b4abda09c79e4ce372a3771300abf568c85c7ff5
|
|
|
|
--without-XXX sets $withval to "no", hence we must check for this special
|
|
value instead of ignoring network interfaces that start with "no".
|
|
---
|
|
configure.ac | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
index 5254154..42d1fe9 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -403,7 +403,7 @@ AC_ARG_WITH([ignored-network-interface-prefix],
|
|
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"],
|
|
+AS_IF([test -n "$interface_prefix" && test "x$interface_prefix" != "xno"],
|
|
[[interface_prefix_list=`echo $interface_prefix | sed 's/,/","/g'`]
|
|
AC_DEFINE_UNQUOTED([IGNORED_IFACE_PREFIX],["$interface_prefix_list"],
|
|
[Ignore this network interface prefix from the connection check])
|
|
--
|
|
2.21.0
|
|
|
|
From 099ff65c0371483ded4a3a7e905adfeea0faf6f6 Mon Sep 17 00:00:00 2001
|
|
From: Stefan Becker <chemobejk@gmail.com>
|
|
Date: Thu, 27 Jun 2019 13:33:25 +0300
|
|
Subject: [PATCH 15/16] build: add default ignore network interface prefix
|
|
|
|
By default libnice now ignores network interfaces from virtual machines
|
|
and containers, i.e. names that start with "docker", "veth", "virbr" and
|
|
"vnet".
|
|
|
|
If you want to disable this feature override the default with
|
|
|
|
./configure --without-ignored-network-interface-prefix ...
|
|
./configure --with-ignored-network-interface-prefix= ...
|
|
meson setup -D ignored-network-interface-prefix= ...
|
|
meson setup -D ignored-network-interface-prefix=[] ...
|
|
---
|
|
configure.ac | 3 ++-
|
|
meson_options.txt | 2 +-
|
|
2 files changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
index 42d1fe9..c1367c4 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -402,7 +402,8 @@ AC_ARG_WITH([ignored-network-interface-prefix],
|
|
[Ignore network interfaces whose name starts with a string from this list in 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"])
|
|
+ [interface_prefix="$withval"],
|
|
+ [interface_prefix="docker,veth,virbr,vnet"])
|
|
AS_IF([test -n "$interface_prefix" && test "x$interface_prefix" != "xno"],
|
|
[[interface_prefix_list=`echo $interface_prefix | sed 's/,/","/g'`]
|
|
AC_DEFINE_UNQUOTED([IGNORED_IFACE_PREFIX],["$interface_prefix_list"],
|
|
diff --git a/meson_options.txt b/meson_options.txt
|
|
index 9f9f7d6..cd980cb 100644
|
|
--- a/meson_options.txt
|
|
+++ b/meson_options.txt
|
|
@@ -2,7 +2,7 @@ option('gupnp', type: 'feature', value: 'auto',
|
|
description: 'Enable or disable GUPnP IGD support')
|
|
option('gstreamer', type: 'feature', value: 'auto',
|
|
description: 'Enable or disable build of GStreamer plugins')
|
|
-option('ignored-network-interface-prefix', type: 'array', value: [],
|
|
+option('ignored-network-interface-prefix', type: 'array', value: ['docker', 'veth', 'virbr', 'vnet'],
|
|
description: 'Ignore network interfaces whose name starts with a string from this list in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.')
|
|
option('crypto-library', type: 'combo', choices : ['auto', 'gnutls', 'openssl'], value : 'auto')
|
|
|
|
--
|
|
2.21.0
|
|
|
|
From b99854746645621b71a68a3510a40a2eca8cce9d Mon Sep 17 00:00:00 2001
|
|
From: Fabrice Bellet <fabrice@bellet.info>
|
|
Date: Thu, 27 Jun 2019 19:52:13 +0000
|
|
Subject: [PATCH 16/16] conncheck: add transport information to debug
|
|
|
|
---
|
|
agent/conncheck.c | 38 +++++++++++++++++++++++++++++++-------
|
|
1 file changed, 31 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/agent/conncheck.c b/agent/conncheck.c
|
|
index 3e02ce0..62a3216 100644
|
|
--- a/agent/conncheck.c
|
|
+++ b/agent/conncheck.c
|
|
@@ -191,6 +191,22 @@ priv_candidate_type_to_string (NiceCandidateType type)
|
|
}
|
|
}
|
|
|
|
+static const gchar *
|
|
+priv_candidate_transport_to_string (NiceCandidateTransport type) {
|
|
+ switch(type) {
|
|
+ case NICE_CANDIDATE_TRANSPORT_UDP:
|
|
+ return "udp";
|
|
+ case NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE:
|
|
+ return "tcp-act";
|
|
+ case NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE:
|
|
+ return "tcp-pass";
|
|
+ case NICE_CANDIDATE_TRANSPORT_TCP_SO:
|
|
+ return "tcp-so";
|
|
+ default:
|
|
+ g_assert_not_reached ();
|
|
+ }
|
|
+}
|
|
+
|
|
/*
|
|
* Dump the conncheck lists of the agent
|
|
*/
|
|
@@ -2034,9 +2050,12 @@ static CandidateCheckPair *priv_add_new_check_pair (NiceAgent *agent,
|
|
stream->conncheck_list = g_slist_insert_sorted (stream->conncheck_list, pair,
|
|
(GCompareFunc)conn_check_compare);
|
|
|
|
- nice_debug ("Agent %p : added a new pair %p with foundation '%s' to "
|
|
- "stream %u component %u.", agent, pair, pair->foundation, stream_id,
|
|
- component->id);
|
|
+ nice_debug ("Agent %p : added a new pair %p with foundation '%s' and "
|
|
+ "transport %s:%s to stream %u component %u",
|
|
+ agent, pair, pair->foundation,
|
|
+ priv_candidate_transport_to_string (pair->local->transport),
|
|
+ priv_candidate_transport_to_string (pair->remote->transport),
|
|
+ stream_id, component->id);
|
|
|
|
/* implement the hard upper limit for number of
|
|
checks (see sect 5.7.3 ICE ID-19): */
|
|
@@ -2952,8 +2971,12 @@ static CandidateCheckPair *priv_add_peer_reflexive_pair (NiceAgent *agent, guint
|
|
pair->nominated = parent_pair->nominated;
|
|
pair->prflx_priority = ensure_unique_priority (stream, component,
|
|
peer_reflexive_candidate_priority (agent, local_cand));
|
|
- nice_debug ("Agent %p : added a new peer-discovered pair with "
|
|
- "foundation '%s'.", agent, pair->foundation);
|
|
+ nice_debug ("Agent %p : added a new peer-discovered pair %p with "
|
|
+ "foundation '%s' and transport %s:%s to stream %u component %u",
|
|
+ agent, pair, pair->foundation,
|
|
+ priv_candidate_transport_to_string (pair->local->transport),
|
|
+ priv_candidate_transport_to_string (pair->remote->transport),
|
|
+ stream_id, component->id);
|
|
|
|
stream->conncheck_list = g_slist_insert_sorted (stream->conncheck_list, pair,
|
|
(GCompareFunc)conn_check_compare);
|
|
@@ -3072,8 +3095,9 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent *
|
|
sockptr,
|
|
local_candidate,
|
|
remote_candidate);
|
|
- nice_debug ("Agent %p : added a new peer-reflexive local candidate %p",
|
|
- agent, local_cand);
|
|
+ nice_debug ("Agent %p : added a new peer-reflexive local candidate %p "
|
|
+ "with transport %s", agent, local_cand,
|
|
+ priv_candidate_transport_to_string (local_cand->transport));
|
|
}
|
|
}
|
|
|
|
--
|
|
2.21.0
|
|
|